GeeCON Prague 2014*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes web app without session creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "web app without session creation" Watch "web app without session creation" New topic
Author

web app without session creation

Chetan Sahasrabudhe
Ranch Hand

Joined: Aug 09, 2004
Posts: 75
I can see that there are ways of putting session existing == live of web app

DD says session-timeout = <=0
api saya setSessionMaxInvactiveTime = < 0

I have a need in my application where I need to generate dynamic resonse but dont want to have burden on session object creation.

my code is not even using session to generate the output the call to servlet is purly stateless and need not have any conversational state after the response is flushed.

The need is so that I am expecting around 10k requests / sec.

creation of session object and later lifecycle management time spent by CPU for that object is clearly a overload on my application.

Is there a way that I can stop session object creation.

I dont want to set session-timeout as 1 as it will surely get my app go on toss.

also want to clarify, if within application no code calls getSession method at all then will tomcat create the session ?


Thanks & Regards<br />Chetan
Saurabh Chaubey
Ranch Hand

Joined: Oct 16, 2005
Posts: 101
Hi Chetan,

In addition to not calling getSession() method on a HttpSession object you also need to set the session attribute in the page directive of all your JSP's to false as it is true by default.

e.g. <%@page session="false" %>

Regards,
Saurabh
Chetan Sahasrabudhe
Ranch Hand

Joined: Aug 09, 2004
Posts: 75
not using jsp
itz pure http communication between a electronic sensor and server.

anyting like this where i can say no sessions kind of option
Saurabh Chaubey
Ranch Hand

Joined: Oct 16, 2005
Posts: 101
Hi Chetan,

If you are not using JSP's and also not calling getSession method than no session would be created and the communication will be completly Stateless.

Regards,
Saurabh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web app without session creation