Hibernate + Spring + Struts extension Struts

Source: Internet
Author: User

Introduction:

In many projects, developers implement their own MVC framework, not because they want to do something fundamentally different from Struts, but because they are not aware of how to expand Struts. Developing Your Own MVC framework can gain full control, but it also requires a lot of resources to implement it (human and material resources). Sometimes this is impossible under a tight schedule.

Struts is not only a powerful framework, but also scalable. You can expand Struts in three ways.

1. PlugIn: If you want to do some business logic during application startup or shutdown, create your own PlugIn class.

2. RequestProcessor: If you want to make some business logic at a certain time point in the request processing process, create your own RequestProcessor class. For example, before each request is executed, you can extend RequestProcessor to check whether the user has logged in and whether he has the permission to execute a specific action.

3. ActionServlet: If you want to perform some business logic during application startup and shutdown and when the request is processed, you can also expand the ActionServlet class. However, you should use ActionServlet when PlugIn and RequestProcessor cannot solve your needs.

In this article, we will use a Struts application example to demonstrate how to use these three methods to expand Struts. The sample code can be downloaded from http://www.onjava.com/onjava/2004/11/10/examples/sample1.zip. Two successful examples of Struts extension are Struts's Validation and Tiles framework.

Let's assume that you are familiar with the Struts framework and know how to use it to create a simple application. If you want to know

Related Article

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.