Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with jsp reuse  RSS feed

 
Olivia Mayo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a program which starts from a servlet, goes to a jsp page then goes back to the servlet again, but this time, it sets attributes to the HttpSession object and then goes back to the same jsp page.
I am encountering a NullPointerException when I return to the same jsp page (2nd time). I am very sure i passed on the attirbutes to the session but when it enters the jsp page and tries to get the session attributes, i get nothing. i've tried using separate pages and it works.
Would someone kindly explain to me what's happening? thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously some variable in the JSP is set to null on the second go-around.
The stack trace should give you the information on where in the JSP things went awry. If necessary you can track dowm the java file that the servlet container created on behalf of your JSP. Take a look at it using the stack trace information and you should be able to find out exactly where its tripping up.
There is nothing inherent in JSP that prevents you from going back to a JSP page in the manner you are trying. In fact, it's done all the time in the case of a submitted form failing some server-side validation check.
hth,
bear
[ May 30, 2003: Message edited by: Bear Bibeault ]
 
Olivia Mayo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip I'll try it out.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!