[jboss-user] [JBoss Portal] - Re: How do I change from session to request?

mwelch16 do-not-reply at jboss.com
Fri Jul 21 08:17:23 EDT 2006


Nevermind I figured it out.  FYI for any other newbies out there.  In order to get a handle on the request within a portlet you have to cast to PortletRequest.  I'm trying to do a proof of concept, and I've never worked with portlets before but have done lots of java server faces applications.    It took me a while to find this.

new java code:

  | FacesContext context = FacesContext.getCurrentInstance();
  | 		ExternalContext externalContext = context.getExternalContext();
  | 		if (externalContext.getRequest() instanceof PortletRequest) {
  | 			PortletRequest request = (PortletRequest)externalContext.getRequest();
  | 		
  | 			System.out.println(request.getParameter("helloForm:firstName"));
  | 			System.out.println(request.getParameter("helloForm:lastName"));
  | 		}else if(externalContext.getRequest() instanceof HttpServletRequest) {
  | 			//do something outside of portal portlet api not in classpath
  | 		}
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959876#3959876

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959876



More information about the jboss-user mailing list