This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes request.getAttribute and request.getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "request.getAttribute and request.getParameter" Watch "request.getAttribute and request.getParameter" New topic
Author

request.getAttribute and request.getParameter

Brusk Baran
Ranch Hand

Joined: Nov 15, 2001
Posts: 132
It seems that even though I explicitly equate the attribute to null in a forwarded jsp page (which will forward itself again to the calling page later); the calling page still has access to the parameters sent to it via a form.
Attribute names @ request scope and the parameter names (which are naturally in the request scope) refer not to the same thing actually ??
It is confusing...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Parameters and attributes are completely separate items.
Parameters are generated by submission parameters (be they form elements or query string parameters), while attributes are placed onto a request under code control. They really have not a thing to do with each other.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brusk Baran
Ranch Hand

Joined: Nov 15, 2001
Posts: 132
ja Bear,
thx, I thought they were the same since both reside on the request scope; and did a small design on this a priori assumption; on which some request parameters wander around strangely.
But handled them appropriately after your post. Created a new req. attribute and check it afterwards in the forwarded pages.
Merci,
B. Baran
 
jQuery in Action, 2nd edition
 
subject: request.getAttribute and request.getParameter
 
Similar Threads
Page vs request
page scope
Question on c:set
Forwarding a variable with request scope
scope of bean in jsp