• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on page 87 of HFS

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankyou for the help.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic