Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in tomcat, session is getting created for each request  RSS feed

 
Arvind Subramanian
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have configured tomcat in netbeans. When ever i request a jsp page, a new session is created. I found this by creating the session listener. so if i set a attribute in session i cant able to get in another jsp page. where is the problem. I even increased session timeout for 30 mins. where will be the problem?
 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you set the value of session object as false than you canot use the session object.

Can you cross check
1)if you have set session as false <%@page language="java" session="false" %> or
2)the element "scope" of <jsp:useBean>.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you have set session as false <%@page session="false" %>

To elaborate on this: By default, JSP pages create sessions. If you don't want them, you need to have the above statement in each of your JSPs.
 
Arvind Subramanian
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@page language="java" session="false" %>
<%@include file="home_header.jsp"%>
<%@include file="home_body.jsp"%>

should we have to add the session false in the included sub jsp or jspf too?

I have many number of jsp files, is there any other more generic solution to solve this problem instead of adding the session-false in all the jsp files?
 
Arvind Subramanian
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i cant able to find the root cause, but after having many frustrating hrs reinstalled webserver tomcat as per
http://forums.sun.com/thread.jspa?threadID=5440234

and now its working fine. but till now dont know the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!