The moose likes Servlets and the fly likes request getAttribute getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "request getAttribute getParameter" Watch "request getAttribute getParameter" New topic
Author

request getAttribute getParameter

FY Hsieh
Ranch Hand

Joined: Aug 07, 2006
Posts: 73
I passed a paramer name value by doing

http://.../Hello.action?v1=value1&v2=value2

In the action class I found I can get

v1's value by

request.getAttribute("v1").toString();

I thought I can only get this value by

request.getParameter("v1")

because it is passed by parameter in URL. Why can I get it from

getAttribute as well ?

I never set it in

request.setAttribute() ...

Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48842

You can't. Something is setting it up as a scoped attribute somewhere.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
 
subject: request getAttribute getParameter
 
MyEclipse, The Clear Choice