Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on page 87 of HFS

 
Sharada Raju
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to jsp. There is a result.jsp on page 87. How does the jsp know that request is HttpServletRequest object. Since its not mentioned in the jsp. And for me when I'm trying to run the example its giving me this error cannot compile jsp because it cannot resolve the request object.
Any help would be appreciated.
Thanks
Sharada
 
Joe McIntyre
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"request" is an implicit reference to the request object. The container makes that (along with other implicit references like "response") available in the jsp service method. When you write a scriptlet <% %> , the code inside the <% %> goes into the jsp service method, and so has access to those implicit references.

Just remember that the container makes a servlet from the jsp page, then compiles the servlet into a class, and that class is a servlet just like any other servlet in the web app.
[ October 15, 2004: Message edited by: Wally Flint ]
 
Sharon
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I am also new in JSP but try to discuss. here is my understanding.
refer to picture on pg 88,
servlet put a gift on request by request.setAttribute ("styles");
and then call result.jsp

The result.jsp weakup, take the gift from request by request.getAttribute ("styles") and display in html format, here ignored who is the caller.

So that result.jsp can be called by (shared with) any other servlet who put gift on request.

Please let me know if I am wrong.
 
Sharada Raju
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou for the help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic