• Post Reply Bookmark Topic Watch Topic
  • New Topic

Websphere Portal NullPointerException

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I am using Websphere Portal version 6 and RAD 7


I am getting this exception (NullPointerException) when i run the JSP below


My Debug shows it is encountering the exception at

PortletSession enu=renderRequest.getPortletSession(true);

Is there a reason why i can't obtain the portletSession
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a wild shot in the dark here, but could it have anything to do with session=false?

-Cameron McKenzie
 
Praveen Belkar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For any jsp there are 9 variable which can be used without defining them viz. request, response, session, config, application, out, exception, pageContext. Here request, response and session refers to HttpRequest, HttpResponse and HttpSession.
When we set session=false in page directive, it means we can't use session variable as it is. But we can get it exclusively by doing request.getSession() in servlet environment and renderRequest.getPortletSession() in portlet environment.

BTW, I was able to run this piece of code without any error. May the exception you are getting is not related to code.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!