• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The implicit object..

 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
According to the JSP1.2 specifications the request implicit object can be the protocol dependent subtype of javax.servlet.ServletRequest
e.g javax.servlet.http.HttpServletRequest
Does this mean it can be either of type javax.servlet.ServletRequest or javax.servlet.http.HttpServletRequest?
Also similar is the case for response.
thanks,
Trupti
 
g madhava
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's of both the types. It's the beauty of runtime polymorphism.
javax.servlet.HttpServletRequest extends javax.servlet.ServletRequest
if you have a request of HTTP Protocol,the request implementation would be of type javax.servlet.HttpServletRequest
Similarly if you have an implementation for FTP protocol,it would have been javax.servlet.FtpServletRequest which again would extend javax.servlet.ServletRequest.
Similarly for the response.
HTH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic