Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

newbie question

 
tom gong
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
following is from sample code:
<html>
<head>
<BASE HREF="<%= request.getScheme() %>://<%= request.getServerName() %>:<%= request.getServerPort() %><%= request.getContextPath() %>/">
</head>
<body>
</body>
</html>
request is a interface, how could it be used without any inplemetation. I did not find any implementation of interface request.
sorry about this question and thanks for help!
tom gong
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The implementation of the interface request is left to the implementors of the Servlet container. So you can always treat it as a "class".
According to Sun:
"The servlet container creates an HttpServletRequest object and passes it as an argument to
the servlet's service methods (doGet, doPost, etc)."

Implementing an Interface in Java is not always the responsibility of the user of an application.
 
tom gong
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, Tony
your help is appreciated.
tom gong
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic