Eight tips for improving struts2 and webwork Performance

Source: Internet
Author: User

According to some tips on the official website, following these steps can improve the performance of struts2. Because struts2 inherits webwork, so webwork is the same.

1. Disable Logging and devmode. devmode is set in struts. properties. To Disable Logging, modify the Web. xml file and add the following parameters.

<Servlet>
<Init-param>
<Param-Name> debug </param-Name>
<Param-value> 0 </param-value>
</Init-param>
<Init-param>
<Param-Name> detail </param-Name>
<Param-value> 0 </param-value>
</Init-param>
</Servlet>

2. Do not use interceptor unless necessary ).

3. correctly set cache-control and expires on the page

4. struts is stored by default in the Ajax theme (Dojo) or calendar tag provided by struts2. in the jar package, copying these JS or CSS files to another server can improve performance.

5. If freemarker is used, create a freemarker. properties under the classes folder under the WEB-INF and add
Template_update_delay = 60000. The value is how long freemarker reloads the template from the hard disk. The default value is 500 ms, because there is no need to check whether the template file needs to be reloaded, so it is best to set it to a large number.

6. Enable freemarker template cache. this parameter is set to true for struts. freemarker. templatescache. By default, this parameter is set to false.

7. Save the use of sessions. Do not use sessions unless necessary.

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.