• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can any body help

 
vijai sahu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic