The most intelligent Java IDE
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JSP
 
RSS feed
 
New topic
Author

implicit request object type

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Messages: 342

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
Failure is not an option.
Bear Bibeault
Author and opinionated walrus
Sheriff

Joined: Jan 10, 2002
Messages: 36595

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
Bartender

Joined: Sep 29, 2008
Messages: 6873

And what are the differences between the two that might influence your decision?

Consultant/Trainer | Polyglottal Developer | Struts Committer/PMC | Struts 2 Web Application Development
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Messages: 342

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....


SCJP 6,SCWCD 5
Failure is not an option.
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Messages: 516

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
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JSP
 
RSS feed
 
New topic
replay challenge

.