struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aum strut <aum.str...@gmail.com>
Subject using property/constant placeholder in struts config file
Date Sat, 17 Dec 2011 12:07:53 GMT
Hi All,

While working in one application i came across a requirement where i need
to define a constant in struts.xml file and want to use in my
application.Here is the use case
in our application the layout is fixed and we are using a same template
throughout the application say

"applicationframe.jsp"
we have fixed the layout for the working template which we decide on run
time based on the action call,everything is working perfectly fine except
one issue as in each action configuration i have to do the following
configuration

<action name="welcome" class="welcomeAction">
            <result>/templates/application/applicationframe.jsp</result>
        </action>

<action name="morewelcome" class="welcomeAction1">
            <result>/templates/application/applicationframe.jsp</result>
        </action>

etc
which means if anyhow at later stage we want to change the name of
applicationframe we need to change it at every place.I was thinking of
creating a constant like
<constant name="applicationframe"
value="/templates/application/applicationframe.jsp"/>
and using its value in the result so if any change occur in future i know i
need to change it only at one place

is there a way i can achieve this?

thanks in advance

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message