• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in sessions with Tomcat 3.2.3

 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,
I am using Tomcat3.2.3 for a small project.
The session is created in a servlet and then forwared to a jsp using sendRedirect().But in the jsp when i use session.getValue("attrb"), it is returning me null.
I have checked the attribute case in both the files and it is the same.Also i have not forgotten to mention to call getSession(true) in the servlet.I have a set timeout of 30(mins) in web.xml.Am i missing something?
Kindly help...!!
Thanks a ton,
Manjunath
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that sessions are valid only within a single "Web Application" - is this page you are redirecting to in the same application / ServletContext? If not, you will have to find some other mechanism for transferring the data.
Bill
------------------
author of:
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SendRedirect does not forward anything to the destination URL. You are sending a response back to the client, indication that they send another request. What you want to use forward the request using the RequestDispatcher. Check the API or use the search facility at the top. This has been discussed a number of times in this forum.
------------------
Bosun
SCJP for the Java� 2 Platform
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks William and Thank you Bosun.Now i am able to get to it to work using RequestDispatcher.
I would like to get clarification frome you guys on couple of more things.
1)The same project works fine in javawebserver2.0 and Jrun3.0 without the usage of RequestDispatcher.How is that?
2)We use MySql as the back end for this project.
When we use a combo of javawebserver2.0 and MySql in a Windows98
machine we get connection problems.Quite frequently we get an exception saying that "could not connect to localhost".But again this problem is not seen on a windows NT Server m/c.
is there any way of overcoming this?
Any suggestions would really be helpful.
Thanks again,
Manjunath
P.S: William your books are

[This message has been edited by Manjunath Subramanian (edited December 15, 2001).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!