Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF-portlet request response object in jsp

 
Rashika Khanna
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to integrate my JSF application with portlets. The problem is in JSP I am trying to use request.getParameter(key) but its giving null. If I typecast it in PortletRequest, same problem exist. Same is the case in java files also, request object is not working.
Is there any way out to get the request-response parameters in JSF-Portlets jsp pages and java classes without using JSF UIComponents.

Thanks in advance,
Rashika
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure about how portlets works. But in java files, you cna get the request/response objects by using ExternalContext object.

You can get the reference of ExternalContext through "FacesContext" , the code must be something like :
FacesContext.getCurrentInstance().getExternalContext()

Why do you need request object in a JSP page can you please explain?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic