Solve the JSP program is not directly, code and UI mixed pain: jspwidget

xiaoxiao2021-03-06  18

Introduction to a very nice Java, Web-based UI solution, people who do web applications with Java know that the pain developed on the web, there is almost no ready-made control on the UI performance, this. Net is indeed more than Java To be strong, even if Struts does not provide a good solution to JSPWidget is a Taiwan's open source UI framework, it provides the event driver, page statine, check, and common components, etc. DropDownList, Panel, TreeView, Menu, etc. And provide detailed documentation and DEMO. In fact, I saw this project a year ago. I happened to everyone today, I hope to learn, refer to, learn from his thoughts.

Project address: http://edu.uu.com.tw/jspwidget

Look at his Menu component effect is very cool: http://edu.uu.com.tw/jspwidget/docs/gUI/Menu_03.jsp

Below is the author's analysis of WebUI:

Design goals

Developing a web-based application has become a mainstream trend of enterprise applications, while JSP has the advantages of all services provided by Java cross-platform and accessible J2EE architectures, and is the best website technology for enterprises in the project. .

However, using JSP to develop a web project is not easy, because JSP is a non-event-driven computing model, UI (HTML Elements) cannot be directly controlled by the rule code, and the status of the UI (View State) It cannot be saved automatically. These factors have caused JSP's program code to be mixed with UI. The intricate UI / program code is not only difficult to development, but also difficulties in future maintenance and expansion.

JSP is obviously not intuitive compared to traditional Client Forms or Client-Based Web Applications programs. The reasons are three, and Z is relatively compared:

Factors CLIENT FORMS Pure JSP Event-Driven Computing Model You can manage events triggered by the GUI Components by writing event handlers (Event Handler). For example, Button's OnClick event or a DropDownList's OnsectChanged event. Because JSP is processed from the next step-by-step processing, you must use the program to determine which button is pressed, whether the user changes the selected menu item, etc., then write the corresponding program based on these judgment results code. GUI COMPOMENT All GUI COMPOMENT's properties and behavior can be fully accessed and controlled by the program code, and the program code is completely separated from the UI. Because JSP is processed from top to bottom, you must insert the program code in the appropriate JSP file location to change the UI of the Output to the browser. But this way of writing is often mixed with UI, which is very difficult to maintain and expand. Retain View State Automatically has no doubt that in traditional Client Forms, the state of the GUI Component is automatically kept in the final user changes to it. Because HTTP is not maintaining (stateless), all HTML ELEMENTs will disappear after the Post back to Web Server. In order to maintain the state of the last user changes to the GUI COMPOMENT, you have to write a program. Keeping the status of HTML ELEMENT is not easy, different HTML ELEMENT needs to use different processing methods. Typically, about 25% of the program is simply a matter of course in the Client Form. JSPWidget is a set of Frameworks built on the JSP standard. Its design goal is to allow program designers to find a JSP web application in intuition, just like developing traditional Client Forms. Simple and simple.

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

New Post(0)