The presentation layer of the software is the most troublesome. Taking network applications as an example, the final output of software must meet the HTML requirements. In addition, HTML elements need to be modified and located, and CSS technology is used. In addition, DHTML and Ajax are required. That is to say, JavaScript technology is also required.
The network framework has two main functions:
1. Inject program data to the presentation layer in the form of software components (such as ActionBean), import user actions passed in at the presentation layer to the background components, and activate business processing;
2. Provides the page browsing definition function. Simply put, the presentation layer and background components are combined reasonably and effectively.
This leads to a problem. Because the presentation layer uses many technologies, the network framework should be as transparent as possible, and do not distort or even mask these basic technologies. However, Struts and JSF obviously do not meet this requirement. They provide too many Tags (tag lib), and they do not know that Tags is an API. Everyone is willing to learn HTML Tags, because HTML is standard and general, but learning the tags of individual frameworks is highly resistant. If a JSP source code is opened, the Framework tag is everywhere, which is a headache. Imagine how painful it would be for developers to use Struts and JSF. These are two sets of Apis!
Another prominent problem is the configuration file. Since the rise of XML, configuration files have become the first headache. XML is unfriendly to humans and machines. However, in the past, the Java Community unilaterally sought flexibility, loose coupling, and many other impractical words. XML configuration files were everywhere. Take Struts as an example. You may need to configure Form data, navigation data, and validation data. You can imagine how huge the configuration files of a medium-sized network application will be. This is not recorded in the configuration file of other components in the background. This will give you a feeling: it is easy to write code, making it difficult for J2EE programs to turn around, and it is more difficult to get the configuration file. Some people have lamented: do we use Java to write programs or XML to write programs ?!
If you pay attention to it, the rise of Spring is nothing more than the east wind of EJB2. The latter is too cumbersome, especially configuration problems and resource injection methods. The rise of EJB3 is a matter of fact. It sums up EJB2's experience and draws on the advantages of Spring. The most significant improvement of EJB3 is to remove XML configuration files! However, annotation is used to obtain and provide reasonable default values.
Obviously, the next successful network development framework must have a qualitative leap in terms of transparency, configuration, and background resource injection. Of course, annotation technology must be widely used. Another important requirement is "Simplicity ".
Well, after half a day, it seems that Stripes is not involved. Stripes is satisfactory in many aspects, such as configuration (without your own configuration file), resource injection, validation, and transparency, and can easily be combined with EJB3 or Spring. The number of Stripes tags and annotation is small and easy to use.
Stripes:Is a view framework used to build Web applications using the latest Java technology. it has the following features: you do not need to configure ing for each page/action (ActionBeans will be automatically discovered and configured using annotations ), the powerful binding engine is used to construct web objects that are complex and independent from request parameters. It is easy to use and can be localized in verification and type conversion systems. you can reuse ActionBean as a view help class. supports multiple events corresponding to one form. transparent file upload capability. continuous Development is supported (for example, JSP can be built and tested before your ActionBean is conceived.
- Java Web development based on the Stripes framework
- Solution for passing parameter garbled characters in Jsp page URLs
- Analysis of JSP secure programming examples