I think, depending on which version of struts you're using, in
struts.xml files, you use $, not % for OGNL expressions... So, try
this -

<action name="mainContent"
class="com.integrationpath.mengine.webapp.action.ArticleAction"
method="list">
    <result 
name="success">/themes/${application_theme}/pages/production/mainContent.jsp</result>
</action>

-Wes

On Mon, Aug 2, 2010 at 10:10 AM, Dale Newfield <d...@newfield.org> wrote:
> On 8/2/10 3:31 AM, colaru wrote:
>>
>> For me is not working. I want something like this:
>>
>>         <action name="mainContent"
>> class="com.integrationpath.mengine.webapp.action.ArticleAction"
>> method="list">
>>             <result
>>
>> name="success">/themes/%{application_theme}/pages/production/mainContent.jsp</result>
>>         </action>
>
> That should work if <s:property value="%{application_theme}"/> would print
> the value you want in the resulting .jsp.
>
>> where "application_theme" is an attribute on Application Context. I want
>> to
>> redirect to a dynamic URL created in runtime based on this variable - and
>> still keep the struts.xml structure.
>
> I'm not sure what you mean by attribute.  Is it a bean?  Is it a message?
>  Something else?  Whatever it is, you should be able to get it by doing the
> following and filling in the appropriate FOO below based the answer to this
> question.
>
> This tells me that you don't have a getApplication_theme() on your action.
>
> If you make your action implement ApplicationContextAware
>
> And add not only
> public void setApplicationContext(ApplicationContext newApplicationContext)
> throws BeansException;
>
> but also
>
> public ApplicationContext getApplicationContext();
>
> Then you should be able to say
> %{applicationContext.bean('application_theme')}
> or
> %{applicationContext.message('application_theme')}
> or
> %{applicationContext.FOO}
>
>
>>
>> "D:\projects\mengine\src\main\webapp\themes\\pages\production\mainContent.jsp"
>> not found"
>>
>> Is like this string is not parsed and variables not replaced with their
>> values.
>
> This must be being parsed, since the %{application_theme} portion is no
> longer present.  It evaluated to an empty string.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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

Reply via email to