wood burning stoves 2.0*
The moose likes Servlets and the fly likes HttpServletRequest request = NULL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpServletRequest request = NULL" Watch "HttpServletRequest request = NULL" New topic
Author

HttpServletRequest request = NULL

Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
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


Regards
Azrael Noor
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61309
    
  66

I have no idea what you are doing. Perhaps some relevant code would be in order?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382



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

Joined: Jul 14, 2010
Posts: 754

Can you show the error message?


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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?
 
GeeCON Prague 2014
 
subject: HttpServletRequest request = NULL