Configure struts2 + spring + hibernate (SSH) in the BAE Environment (2) struts2

Source: Internet
Author: User

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 ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.