How to set up applicationcontext.xml in eclipse

when i put struts.xml in web-inf it shows error ...... when i paste src folder it works fine. (being applicationcontext.xml in web-inf)

(being struts.xml in (src folder or src / resources)) when I put applicationcontext.xml in src folder ......... it says it can't find applicationcontext.xml in web-inf folder. .......... fails.

how to configure so that eclipse can find the struts.xml or applicationcontext.xml path so that wherever I put it it needs to be discovered.

the code in web.xml looks like this.



Thanks everyone.


source to share

2 answers

Configure context parameter in web.xml as shown below:

    <param-value> /WEB-INF/application-context.xml</param-value>


And put your application-context.xml in WEB-INF folder.



if you paste the web-inf folder



if you paste the src / resource folder



one more thing if you get an error like below after making changes.

the solution is given at the end.

or you can do the following.

in struts.xml <constant name="struts.devMode" value="false" />



All Articles