At the beginning, I thought it was because I first loaded
1
2
3
4
5
> java -jar start.jar
An error message is displayed during startup, and an error message is displayed ~~
Sorting
Struts2 org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter struts2/* index. jsp
According to this configuration, place an index. jsp in WebRoot.
Successful access indicates that struts2 has been successfully loaded and the server is normal.
The result is still incorrect. The 404 error result 'null' not found is returned.
My actionclass directly returns a string, so it should not be a class problem.
After reading this document, I found that Baidu's documents contain
2. ognl
Struts2 depends on ognl. When using ognl, You need to configure a listener to disable the ognl security manager. The Listener implementation code is as follows:
public void contextInitialized(ServletContextEvent sce) {OgnlRuntime.setSecurityManager(null);}
Add the listener Configuration in web. xml.
The next step is to configure this listener. Baidu did not provide the complete code, so I found one in the SAE (SINA app server) document.
InitListener. java:
InitListener
Add the listener Configuration in the web. xml file:
InitListener
After testing, you can use action normally ~
Now, struts2 has been done, but it turns into 503 again when it finds a problem. Even if it returns to the previous status, it will still be 503, copy the result to a new version ~