I created a property for the attribute, then reference it by $propName,
and it works. Thanks Dave!

Also thanks Jim for pointing me to the struts 2 cookbook. That is a
great resource!


-----Original Message-----
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 24, 2007 11:08 AM
To: Struts Users Mailing List
Subject: Re: [Struts 2] Read request attribute in struts.xml

Xibin Liu wrote:
> Hi, I set an attribute in the request in the action code, and I want 
> to use it in the struts.xml (see below). How can I reference it at the

> place marked
by
> ***?
> 
> 
> <action name="actionname" class="classname">
>   <result type="redirect">
>     <param name="location">***</param>
>     <param name="parse">true</param>
>   </result>
> </action>

(Ugh, mixed tabs and spaces :p Tabs are bad enough! ;)

> I tried #request.attname, it did not work.

Did you try $request.attname or $parameters.attname?
The EL here is OGNL, but confusingly uses a "$"
instead of an "%".

Is there a particular reason you're putting it in the request instead of
making it an Action property? If it's a property referencing it with
$propName is known to work.

d.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to