1

I'm writing a test application using struts2. In this app I set a context-root in weblogic.xml file:

  <context-root>/myapp/test/exec</context-root>

And now I tried to access an action with following link: http://localhost:8081/myapp/test/exec/myAction.action

I get Error 404--Not Found - The server has not found anything matching the Request-URI

My struts.xml is

<package extends="struts-default" namespace="/" name="common">
    <action name="myAction" class="com.test.MyAction">
        <result>pages/js/welcome.jsp</result>
    </action>
</package>
Ariana
  • 283
  • 1
  • 6
  • 17

1 Answers1

1

The struts.xml should be in src or resources folder in your project structure. WEB-INF/classes is a bad place because this folder might be recreated by the build tool and the file will be removed from the final war.

Without action configuration you can't access action classes from HTTP. However if you use convention plugin or something that generates this configuration based on code conventions then you might find the URLs in the config-browser web site that you can access even if you don't have struts.xml

You can read more about action configuration, convention and config-browser plugins on the Struts guides site.

Roman C
  • 49,761
  • 33
  • 66
  • 176