New generation web user interface building framework

zhaozj2021-02-16  105

New generation web user interface building framework

JWF (Java Web Form) technology

Wang Yonghe

Today's information management software has gradually developed to the web, but the defects in the web are difficult to build ideal user operation interfaces, which is difficult to reuse using Script writing some controls, not to say is an object-oriented design The method is designed, which increases the difficulty of development and maintenance of large systems, so the current software company is also developed using C / S mode so that the user's operating interface can be generated using third-party controls, which saves the development cycle. The same difficulty is small, most of the time is used in demand analysis and business modeling, and later maintenance is also easy, because the amount of code is smaller, the less chances of error.

However, the new technology will finally replace the old technology, this requires someone to dare to do, not afraid of failure, and strive to enter. With the continuous update of the web framework, Web development is constantly improving, Struts, JSF, etc. Excellent framework gets a lot of Java hobbies, but there is still no fundamental solution in these frameworks, Struts or With taglib's way to achieve basic controls (there are some extended controls), so that the development of user interface can only be some HTML tags, add some extension tags, increase the complexity of development, before joining Java in JSP Code, now add extension tags, basically there is not much progress.

The above is a simple introduction to the shortcomings of Web development. This is just my personal opinion. Let's introduce the WebForm technology I develop, the class structure is as shown in the figure.

WebForm mainly uses JDOM to build an HTML tag tree, first build a general HTML object through the HTMLOBJECT class, then build an extension object to genericeXtendObject, mainly a commonly used control, such as menu, toolbar, tree, etc. The properties of the HTML basic object in the control are added to the WebForm-Infomatio.xml file via the PropertiesAdder class, and then call the UIBUILDER's implementation class to generate the user interface in the action in the action. If the user's interface is more complicated or worrying is too slow, it can be used to use the extended tag, as long as the output tag is outputted, after combining these basic HTML tags, some JavaScript, CSS, these will be referenced According to the JS involved in the control, the CSS is added, and the following is the code of two examples.

In // Struts Action

Public class resourceAction extends dispatchaction {

Public ActionForward Open

ActionMapping mapping,

Actionform Form,

HTTPSERVLETREQUEST REQUEST,

Httpservletresponse response

Throws exception {

Window window = new window ();

Lable lable = new lable ();

Lable.addText ("Hello World");

WINDOW.ADDCHILDREN (LABLE);

Window.Printhtmltag (response.getwriter ());

Return mapping;

}

}

The client output is:

?

?

??? Hello World

?

?

转载请注明原文地址:https://www.9cbs.com/read-10767.html

New Post(0)