Forums Register Login

Session Problem

+Pie Number of slices to send: Send
MyApp
|
|
|---[JSP]
| |
| |-[Module1]
| |-[1.jsp]
| |-[2.jsp]
| |-[3.jsp]
|
|---[WEB-INF]
|
|--[classes]
|
|-[MyServlet]

I submit my request to MyServlet as /servlet/MyServlet and in response got the 1.jsp as well as initialiing session variables. Next I upload file from 1.jsp and Data post to /JSP/1.jsp. this jsp used some functionality to parse the file and store it on disk. After that process over the page completes loading and Now When I submit it to /servlet/MyServlet.
The problem is when I submit to /servlet/MyServlet second time, the previous session is not exist.
+Pie Number of slices to send: Send
Some code would be helpful..
+Pie Number of slices to send: Send


Next I upload file from 1.jsp and Data post to /JSP/1.jsp. this jsp used some functionality to parse the file and store it on disk. After that process over the page completes loading and Now When I submit it to /servlet/MyServlet



Submitting the request to same 1.jsp ? Check if you have created a new session in between these..
+Pie Number of slices to send: Send
You may try to check if your browser has cookies disabled, or check for lines in your code that may have invalidated the session.
+Pie Number of slices to send: Send
Sorry Sebastian, I can not post the code.

Yes Balu, I am submitting the request to the same file. The project is already developed and I can not add any servlet to it. Actually the 1.jsp job is to upload the file and store it at server.

Hi lhorenz, I checked with Browser settings, that was not problem. But MyServlet is checking the session and it can not identify the old session.


My question is :- submitting the request to /servlet/MyServlet and /JSP/1.jsp can use the same session (already exist), As both are in same application ?.

And thnaks all for your reply.


+Pie Number of slices to send: Send
 

But MyServlet is checking the session and it can not identify the old session.


Did you mean that the old session was terminated? Or it is just the session attributes that are gone? What is the result if you check session.isNew() ?
+Pie Number of slices to send: Send
Just a wild guess-

check session timeout parameter, if you have not set it, its by default 30 min.

If it takes more time to upload the data than your session timeout period, then by the time you get ready to submit the page, your session would time out.
+Pie Number of slices to send: Send
The session get reset and I m getting different session id.
+Pie Number of slices to send: Send

The session get reset and I m getting different session id.



That does means that your browser cannot maintain session with server. Check if cookies are enabled. or use encodeURL().
Replace the word "snake" with "danger noodle" in all tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1611 times.
Similar Threads
Servlet and JSP interaction
Doubt in Session Time out.
Calling "/servlet/MyServlet" from HTML form
xml mapping Head First Servlets and JSP
WEB-INF doubt?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:41:30.