struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gaurav Arora" <gaura...@tyroo.com>
Subject RE: [S2] Fetching request parameters in jsp
Date Tue, 19 Feb 2008 05:24:02 GMT
Thanks. As I suspected I was missing something really obvious. 

-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com] 
Sent: Tuesday, February 19, 2008 4:04 AM
To: Struts Users Mailing List
Subject: Re: [S2] Fetching request parameters in jsp

On top of the OGNL error, your JSP page is also incorrect. Your taglib
declaration points to 's' as the prefix, but you are using '<saf' as the
prefix to the property tag. It should be '<s:property' 

-Wes

On Mon, 2008-02-18 at 10:19 -0500, Laurie Harper wrote:
> 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-re
> >>> quest-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
> 


---------------------------------------------------------------------
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