• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How do you access HttpServletResponse in JSF

 
Ranch Hand
Posts: 124
C++ Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay I have run into a little problem here.. I need to use HttpServletResponse to access and pass around cookies.
Here is the thing the front is the facelet page and it gets its entire contents from a bean (a managed bean) at the back end and this managed bean is a pojo i was looking here http://gthill.blogspot.com/2008/01/cookies-in-jsf.html and it says that i have to use HttpServletResponse ?? How can i use HttpServletResponse in a pojo (bean)??? Am i missing anything ?? any help would be appreciated thanks..
 
Saloon Keeper
Posts: 28804
212
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
This sounds like a revival of your earlier question https://coderanch.com/t/544124/JSF/java/obtain-response-object-jsf . As a rule, we'd rather you just continue the original thread, to avoid confusion. Then again, we also discourage "bumping", so you can't win.

Your problem is that you assumed the solution before considering what the real question was. What you ACTUALLY want is access to cookies. The fact that HttpServletResponse is the low-level mechanism that does that isn't really the point, since, as I mentioned in the previous thread, the servlet response stream isn't really yours to play with in JSF.

On the other hand, I managed to find a much more elegant solution about 3 entries down on the Google list from the one you did:

http://stackoverflow.com/questions/5557710/how-to-use-cookies-in-jsf
 
reply
    Bookmark Topic Watch Topic
  • New Topic