Two Laptop Bag*
The moose likes Servlets and the fly likes Request attribute and request properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Request attribute and request properties" Watch "Request attribute and request properties" New topic
Author

Request attribute and request properties

zelynn goay
Ranch Hand

Joined: Jan 09, 2005
Posts: 30
Hi, i am quite confused with request attribute and request properties. please help. Thank you.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Do you mean requestAttributes and requestParameters?

Request parameters are generated by the container from the HTTP querystring and post parameters.

Request Attributes are object that you bind to session in order to be able to retrieve them in another component. The most typical example would be to bind a bean to request scope from a servlet with request.setAttribute(id, object) from a servlet (controller) and then retrieving it from a JSP (view) using request.getParameter(id) or a jsp:useBean tag.
[ June 14, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
The most typical example would be to bind a bean to request scope from a servlet with request.setAttribute(id, object) from a servlet (controller) and then retrieving it from a JSP (view) using request.getParameter(id) or a jsp:useBean tag.

That should actually read request.getAttribute(id).

(It is very rare that one gets a chance to correct Ben regarding servlets... must have been an early morning today )


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request attribute and request properties
 
Similar Threads
Login/Register based web page presentation
Need Help!
Doubt in JSTL
exception object and EL
Can we have jsp:getProperty without jsp:useBean