This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Server Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Server Error" Watch "Server Error" New topic
Author

Server Error

Anila Mathew
Ranch Hand

Joined: Jun 16, 2004
Posts: 69

If i click on a link when the session times out, i am getting a server error .How can i solve this??
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
you can use a session listener and on sessionDestroyed(HttpSessionEvent) you can forward the user to any page i.e. login page.

i think if you define a welcome page in your web.xml. any request after timeout will be automatically forwarded to the welcome page. not sure about it.

<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874


<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>


this solution is not working with me. try it out.
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
You're thinking of:


Jules
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
yeah i got it thanks Jules. do it like this as Jules said. it will work.
Ajith Anand
Ranch Hand

Joined: Aug 30, 2004
Posts: 40
or

if you need PAGE specific exception handlers , instead of a generic exception handler you may add headers as the ones below in your jsps':


PAGE1.JSP





PAGE2.JSP



LXI Technologies P Ltd
[url]www.lxisoft.com[/url]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Server Error
 
Similar Threads
tomcat error
j2ee Server Error
Doubt in ajax4jsf
Doubt on insert statement in JDBC!!
Connection refused