Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Choose not to create a session for a servlet?

 
Ted Bell
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a monitoring servlet that is part of an application. The servlet returns an XML document to a monitoring application. The main user application requires sessions to be created and tracked, but the problem is that the monitoring application looks like it is creating a new session with each call to the servlet.
Can I (either through the DD or the servlet code) tell the container *not* to create a session if the request comes only to that servlet?
Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that not creating a session is the default. You have to specifically call getSession to get one created.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic