File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSP
Bookmark "request.getAttribute and request.getParameter" Watch "request.getAttribute and request.getParameter" New topic

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

Joined: Jan 10, 2002
Posts: 63838

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.

[Asking smart questions] [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.
B. Baran
I agree. Here's the link:
subject: request.getAttribute and request.getParameter
It's not a secret anymore!