Question

I'm new to struts2,In fact new to web application development just started developing a sample application. Currently I'm using struts tiles concept in my project. Here is how I am referring to tiles.xml in my application.

 <listener>
            <listener-class>
                org.apache.struts2.tiles.StrutsTilesListener
            </listener-class>
    </listener>
    <context-param>
            <param-name>tilesDefinitions</param-name>
            <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>

I'd like to place tiles.xml to resources folder of application, despite of placing it inside web-inf folder. How can I refer to that in web.xml.

Was it helpful?

Solution

Moving configuration files from their original location is something dangerous, and shold be examined case by case.

But usually you can use a trick: place a stub xml configuration file in the place where it is expected to be, that contains only the include of the real file, located out of the WEB-INF (or inside it but in another location):

<struts>
   <include file="..\struts.xml"/>
</struts>

As described here: http://struts.apache.org/2.x/docs/struts-1-solutions.html

For properties it's harder... be careful

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top