You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by meeboo <de...@gmail.com> on 2007/07/12 12:55:40 UTC

Accessing constants in Struts.xml

Hey all

How can I access constants via my S2 mapping files? At the moment I have the
following mapping:

<action name="upload" class="com.myapp.web.struts.page.UploadMovie">
<result name="login"
type="redirect">${UMA_REDIRECT_URL}http://myapp:8080/app/upload.action</result>
<result name="success">/uploadMovie.jsp</result>
</action>

${UMA_REDIRECT_URL} is a constant declared in UploadMovie - but I can't
access it in Struts.xml. If I on the other hand write something in the likes
of 
<result name="login"
type="redirect">${getRedirectUrl()}http://myapp:8080/app/upload.action</result>

and then return the constant via getRedirectUrl() it'll work. Is there a
specific way in which you should access  static final values in Struts.xml?

Cheers!
-- 
View this message in context: http://www.nabble.com/Accessing-constants-in-Struts.xml-tf4067389.html#a11557648
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