struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: [S2] Fetching request parameters in jsp
Date Mon, 18 Feb 2008 15:19:56 GMT
Oops, and here's the link:

http://struts.apache.org/2.x/docs/ognl-basics.html

Laurie Harper wrote:
> Yup; specifically, request attributes are available through #request 
> while request parameters are available through #parameters:
> 
> 
> Nils-Helge Garli Hegvik wrote:
>> Request attributes are not the same as request parameters.
>>
>> Nils-H
>>
>> On Feb 18, 2008 2:16 PM, Gaurav Arora <gauravsworld@gmail.com> wrote:
>>> I'm in the process of learning struts and I have a very simple jsp
>>> with a very simple Action behind it (doing no processing, simply
>>> returning SUCCESS). I want to access a get parameter in the jsp and
>>> print it out. This page :
>>> http://struts.apache.org/2.x/docs/accessing-application-session-request-objects.html

>>>
>>> says that I can simply do <saf: property value="#request.myId" /> in
>>> the jsp but that doesn't seem to work.
>>>
>>> My jsp is (a.jsp):
>>> <!DOCTYPE html PUBLIC
>>>         "-//W3C//DTD XHTML 1.1 Transitional//EN"
>>>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>>
>>> <%@taglib prefix="s" uri="/struts-tags" %>
>>>
>>> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>>> <head>
>>>         <title>Hello World</title>
>>>         <s:head />
>>> </head>
>>> <body>
>>>         Id is : <saf property value="#request.id" />
>>> </body>
>>> </html>
>>>
>>> And i'm accessing it using a.jsp?id=xxxx. Am I missing something
>>> really obvious here?
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message