• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

implicit request object type

 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65217
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you think? How could you test to see if you are correct?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what are the differences between the two that might influence your decision?
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic