• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Session Handling without Cookies

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I use Mojarra 2.1.2 under Tomcat 7.0.12. I want to write a JSF application using facelets that also works with cookies disabled in the client. Only using servlets and JSP, this works perfectly, you only have to response.encodeURL each URL which is displayed to not loose the current session.

How to manage that in JSF?

I have a simple facelet, say demo.xhtml, wich contains something like this

<h:form>
<h:commandLink value="Login" action="#{bean.doSomething()}" />
</h:form>

With cookies enabled, clicking on the link works as desired and the content of the doSomething() method of the ManagedBean bean (in RequestScope) is executed. However, clicking on the link after disabling cookies raises viewId:/facelets/demo.xhtml - View /facelets/demo.xhtml could not be restored.

The source obtained via the browser shows that there is no sessionid appended to the link. Then the server cannot identify the session any more.

The same with a <h:commandButton>, and with Glassfish 3.1 and its own JSF Library.

Does anyone have an idea what I am missing to not lose sessions without cookies?

Thank you.

Chris
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic