Webwork Development Summary

Source: Internet
Author: User

Recently I made a small web project, and found many unreasonable aspects in the development process. I would like to make a small summary when I have time:
1) easily tested damage of webwork
This is one of the most common stupid mistakes in my design. Originally, webwork was famous for its ease of testing. However, in my design, it always provided servlectcontext intrusion. The most common example is to generate staticArticle. Because it is necessary to generate HTML href by the way, And href I naturally use the path of servletcontext. Adding this feature to the business logic makes it difficult for me to perform unit tests.
Conclusion: Use servletactioncontext with caution!
2) Try to use ognl.
Ognl reduces or increases the usage of sessions.CodeCleanliness is crucial. If you use webwork instead of ognl, it means that you do not have a good understanding of webwork.
Conclusion: Let ognl complete most of your actions related to Web Submission, without manually writing code.
3) The order in which ognl assigns values to parameters.
Some parameter values must be prior to other parameters in the application, for example, ID values in the update operation. In this case, the default interceptor provided by webwork does not comply with the specifications and can be overwritten.

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.