• Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpSession question?

 
Jeff Madrid
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running Tomcat 4.1.30. I'm using both a Servlet and a Struts Action to call a JSP. I've included the session="false" attribute in the page directive and I do not reference a session in the Servlet or Action. Regardless, Tomcat creates a session according to the Tomcat Manager application. How can I prevent the overhead of Tomcat creating an unneeded session. My hack workaround is to call session.invalidate() but this does not prevent the expense of session creation. Thanks in advance for your time.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you have discovered, setting the session attribute to false merely prevents the page from participating in any session.

Why are you worried about the infintessimal overhead of the server creating a session?
 
Jeff Madrid
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I navigate between several pages none of which need session access. In your opinion, is the resource overhead greater to invalidate the session created with each page request (my current hack) or the memory used to maintain a session for each site visitor?

Thanks for your previous reply.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, why are you concerned with such a matter of minimal overhead? Is there a real performance issue you are trying to track down, or are you just a victim of "premature optimization"?
 
Jeff Madrid
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get it. Thanks Bear.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!