aspose file tools*
The moose likes JSP and the fly likes can any body help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "can any body help" Watch "can any body help" New topic
Author

can any body help

vijai sahu
Greenhorn

Joined: May 29, 2008
Posts: 1
can anybody tell me in my jsp application some time when i am clicking on hyperlink its redirect page to login page
due to geting data from session .how i can resolve this.the code snippet is
try
{
String sub_id=(String)session.getAttribute("subscriber_id");
sub_id=sub_id.trim();
System.out.println("Subscriber Id ="+sub_id);
}catch(Exception e)
{
System.out.println("Error in getting data from session!");
String urlE = "http://"+request.getServerName()+":"+request.getServerPort()+"/cdr/jsp/login.jsp";
response.sendRedirect(urlE);
}
Suresh Kumar
Greenhorn

Joined: May 26, 2008
Posts: 6
Hi Vijai,

This may occur when the attribute 'subscriber_id' does not exist on the session. It will be better to ensure that subscriber_id always exists on session before trying to use it.


Suresh.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

vijai sahu,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseAMeaningfulSubjectLine

"can any body help" tells us nothing about the nature of your app.
Many people won't even open a thread if the subject line doesn't describe what's in it.

Again, welcome to JavaRanch and good luck with your question.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: can any body help