The moose likes JSP and the fly likes implicit request object type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply 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: 377
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?

This message was edited 1 time. Last update was at by Bear Bibeault


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48844

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
And what are the differences between the two that might influence your decision?
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 377
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: 639
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
 
 
subject: implicit request object type
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com