File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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?


Failure is not an option.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

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

[Asking smart questions] [About Bear] [Books by Bear]
David Newton

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: 650
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
I agree. Here's the link:
subject: implicit request object type
It's not a secret anymore!