how do i configure applicationcontext.xml in eclipse

前端 未结 2 1352
青春惊慌失措
青春惊慌失措 2021-01-20 19:49

when i put struts.xml in web-inf it is showing error......when i put in src folder it is working fine.(being applicationcontext.xml in web-inf)

(being struts.xml in

相关标签:
2条回答
  • 2021-01-20 19:57

    if you are putting in web-inf folder

    <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/applicationContext*.xml</param-value>
    </context-param>
    

    if you are putting in src/resource folder

    <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath*:applicationContext*.xml</param-value>
        </context-param>
    

    one more thing if you get the error like the below link after doing modification.

    http://www.bpjava.net/Struts2_Configuration_Plugin/config-browser/showBeans.action

    the solution is given at end.

    or you can do the following.

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

    0 讨论(0)
  • 2021-01-20 20:14

    Configure context-param in web.xml like below:

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

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

    0 讨论(0)
提交回复
热议问题