struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rakeshxp <rakes...@gmail.com>
Subject Re: Result Annotations
Date Fri, 29 Aug 2008 13:50:25 GMT

Awesome. This worked!

Thanks!


newton.dave wrote:
> 
> --- On Fri, 8/29/08, rakeshxp wrote:
>> I am using Result annotations in the following manner (static way )
>> @Results({
>>     @Result(name = "index", value =
>> "/jsp/en_US/help.jsp")
>> })
>> 
>> How can I pass a dynamic value to the result annotation, so
>> that I can achieve something like this 
>>
>> @Results({
>>     @Result(name = "index", value = "/jsp/${locale}/help.jsp"),
>>     @Result(name = "show", value = "${show}" )
>> })
>> public class HelpController {
>>     private String locale;
>>     private String show;
>> ...
>> }
> 
> By either (a) providing getLocale()/getShow() methods or making
> locale/show public.
> 
> The other response saying it wasn't possible is incorrect; while it's true
> that the annotations are scanned on startup, the value is evaluated at
> runtime. See [1] for more information; annotations share the same ability.
> 
> Dave
> 
> [1] Parameters in configuration results
> http://struts.apache.org/2.x/docs/parameters-in-configuration-results.html
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Result-Annotations-tp19214472p19220361.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message