• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Request Object

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can we get Request Object in JSf
How ever i have Used request object through
FacesContext Object but it throws exception
Thanks in Advance
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think is not very clear your question. Please be try to explain it better.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are looking for the Request Object, FacesContext is the place to take it from. What is the exception? Your post can have more details.
 
Charan raj
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FacesContext faces=getFacesContext().getCurrentInstance();
ExternalContext ext=faces.getExternalContext();
RenderRequest req=(RenderRequest)ext.getRequest();

I took the request Object from the above code :

The Excepion is:

0000022 jsf E com.sun.faces.lifecycle.InvokeApplicationPhase execute #{pc_LoginPage.doSbmAction}: javax.faces.el.EvaluationException: java.lang.ClassCastException: com.sun.faces.context.MyHttpServletRequestWrapper incompatible with javax.portlet.RenderRequest
javax.faces.FacesException: #{pc_LoginPage.doSbmAction}: javax.faces.el.EvaluationException: java.lang.ClassCastException: com.sun.faces.context.MyHttpServletRequestWrapper incompatible with javax.portlet.RenderRequest
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:79)
 
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like you have a portlet JSF app. I'm rusty on that, but I seem to recall that for portlets, you don't get an HttpRequest - they have their own specialized equivalents.
 
Andres Quinones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Charan I think that your Exception is being generated because you probably need to cast the Request to HttpServletRequest.


Hope this helps.
 
Joe Matthew
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For Portal depending on which Portal you are using, returns a PortalRequest. The best way to find out is to take that request as an object and print the class. You will find out the name of request.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic