File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

can any body help

vijai sahu

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
String sub_id=(String)session.getAttribute("subscriber_id");
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";
Suresh Kumar

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.

Ben Souther

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:

"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.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: can any body help
It's not a secret anymore!