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

Reply via email to