This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpServletRequest request = NULL

 
Azrael Noor
Ranch Hand
Posts: 384
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServletRequest request = Null; is throwing NULL Pointer Exception
when i use Request then it says you have to initialize HttpServletRequest.

What to do in this situation, i am making method aside of process which will use REQUEST.SETATTRIBUTE
for that i defined HttpServletRequest request in that method
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea what you are doing. Perhaps some relevant code would be in order?
 
Azrael Noor
Ranch Hand
Posts: 384
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



in post authentication


in second portion of code i have to use REQUEST...for that i have to declare global variable
or local
but i am not getting how to because it is throowing null pointer exception
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Azrael Noor wrote:in second portion of code i have to use REQUEST...for that i have to declare global variable or local

You know there's only one servlet per servlet mapping, right?

Why wouldn't you just pass the request to the method?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic