1

How can I configure tomcat to disable sessions in JSP? In each JSP file I can write

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

I think one configuration have to be for all jsp files.

gall
  • 11
  • 2
  • Are you building your own session management routines that you wish to use instead of the container provided one? Or are you simply trying to enforce JSPs from not creating sessions? If it's former, then Sandeep's answer is in the right direction. If it's latter, I'm afraid there is no easy way to do this except to verify in all JSPs. – Vineet Reynolds Jun 14 '11 at 09:02
  • Yes, I use container provided managment and I want to enforce all JSP files from not creating sessions. – gall Jun 14 '11 at 09:38
  • Can I ask why? There could be other ways to solve your problem, without implementing it this way (now that it is not possible). – Vineet Reynolds Jun 14 '11 at 09:41
  • We don't use tomcat sessions: don't save any data to it and etc. And in high load rate catalina StandardManager used 25% of all memory. If I turn off session in all JPSes (session="false") this problem will be fixed. And question - how can I turn off session creaition in all JPS in tomcat configuration? – gall Jun 14 '11 at 11:48
  • Check these questions out http://stackoverflow.com/questions/3415188/how-to-disable-default-servlet-container-session , http://stackoverflow.com/questions/2255814/can-i-turn-off-the-httpsession-in-web-xml . I'm not sure if those answers would help in constraining memory usage though. – Vineet Reynolds Jun 14 '11 at 11:52
  • In our case we decide to add session="false" in each JSP files. It is easy than create own session manager – gall Jun 14 '11 at 12:23
  • Well, then there is no central configuration parameter to set the session attribute to false in each JSP file. This would have been possible for certain other parameters, but definitely not for this one. – Vineet Reynolds Jun 14 '11 at 12:25

1 Answers1

1

One way you need to do this is disabling session of the servlet container.

This implemenation of this would be container specific, but you can do this in Tomcat using The Manager Component

Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121