• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpServletRequest request = NULL

 
Azrael Noor
Ranch Hand
Posts: 385
  • 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: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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: 385
  • 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
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic