wood burning stoves 2.0*
The moose likes JSP and the fly likes implicit request object type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "implicit request object type" Watch "implicit request object type" New topic
Author

implicit request object type

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Have a quick quesion.

What is the type of request implicit object?

ServletRequest or HttpServletRequest?.

I know HttpServletRequest extends ServletRequest,so if i have both the options then what would be my best choice?

or is this question itself is irrelevant?


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

What do you think? How could you test to see if you are correct?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

And what are the differences between the two that might influence your decision?
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
There are quite some differeces that i can find out ..

Let say if the request type is of ServletRequest then we can not get some of the container generated objects like HttpSession and may not be able to get the headers etc.

I tried to see the generated Servlet via netbeans for one my jsps and i could not see this particular request or response implicit object declared in the servlet....

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
But what class does your servlet extend?

When you look at the API for that class, what does it say it will pass to your servlet's doGet or doPost methods?

Doesn't that tell you what you will have to work with?

I think, though, the others were trying to get you to think about the broad differences between the ServletRequest and HttpServletRequest types. If you had to hazard a guess, what would be the number one biggest difference?

Hint: Don't think too hard about it. It's looking at you right in the face
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: implicit request object type
 
Similar Threads
ServletRequest or HttpServletRequest ?
JSP's request scope and request implicit object
types of implicit variabless
ServletRequest / HttpServletRequest
JSP implicit Object HttpServletRequest or ServletRequest ?