Paper 2 - Websites Based On J2EE of Struts
Paper 2 - Websites Based On J2EE of Struts
Abstract. Establishing Web service based on the layer structure could raise the
efficiency of Web development, it could manage the system structure
effectively; lower the complications and the supporting difficulty. The
important technology of MVC software designing model was the separating of
the operation code with the view code, struts was the implementation of the
MVC model based on the Web form according to the J2EE. It was analyzed the
MVC software designing model, JSP MODEL 2 frames, the main technology of
the struts, expatiated the advantage and disadvantage of the Web development
form based on the struts in details.
1 Introduction
Java is used in a wide variety of computing platforms from embedded devices and
mobile phones on the low end, to enterprise servers and supercomputers on the high
end. The development platforms of java can be divided into Java SE, Java EE and
J2ME.
J2SE is used for general-purpose on desktop PCs, servers and similar devices.
J2ME is the Micro Edition of JAVA. It specifies several different sets of libraries for
devices with limited storage, display, and power capacities. It often used to develop
applications for mobile devices, PDAs, TV set-top boxes, and printers.
J2EE means Java Platform, Enterprise Edition or Java EE. It is Oracle’s enterprise
java computing platform. The platform provides an API and runtime environment for
developing and running enterprise software, including network and web services, and
other large-scale, multi-tiered, scalable, reliable, and secure network applications.
J2EE defines the core set of API and features of Java Application Servers. The Web
modules include servlets, and JavaServer Pages.
JSP (JavaServer Pages) is a Java technology that helps software developers serve
dynamically generated web pages based on HTML, XML, or other document types.
Architecturally, JSP may be viewed as a high-level abstraction of Java servlets. JSPs
are loaded in the server and are operated from a structured special installed Java
server packet called a Java EE Web Application, often packaged as a file archive.
With the gradual development and wide application of the J2EE system, some
excellent application frames appeared. Among these frames, Struts was a more
C. Liu, L. Wang, and A. Yang (Eds.): ICICA 2012, Part I, CCIS 307, pp. 31–36, 2012.
© Springer-Verlag Berlin Heidelberg 2012
32 C.-L. Jiao and J.-P. Wang
popular one. It was a project which ASF supported, by using the technology of JSP ,it
accomplished the application frames based on the MVC design form of J2EE web,
Struts was a categorical product of MVC, It made the developer free from the trivial
work and exploited further web application ,Saving the time of designing frames,
struts let the developer concentrate on how to cope with the problem of real business
,which greatly simplified the development process of web application .Thus it
shortened the development period and improved the development efficiency.
2 MVC Model
MVC is short for model view controller. MVC is a software architecture, currently
considered an architectural pattern used in software engineering. The model manages
the behavior and data of the application domain, responds to requests for information
about its state, and responds to instructions to change state. In event-driven systems,
the model notifies observers when the information changes so that they can react.
MVC was a design form and it compelled to part the input, treatment and output of
the application program. It divided the application program into three core modules:
pattern view and controller, which undertook different task.
Model: business logic layer, realizing the function of specific business logic and
state control.
View: expression layer, reading the interface of interaction with the user and the
function of date input and output. The view renders the model into a form suitable for
interaction, typically a user interface element. Multiple views can exist for a single
model for different purposes. A view port typically has a one to one correspondence
with a display surface and knows how to render to it.
Controller: control layer .Realizing the function of Flow control and the
cooperation between view and Model. The controller receives user input and initiates
a response by making calls on model objects. A controller accepts input from the user
and instructs the model and a view port to perform actions based on that input.
The relation of Model, View and Controller shows as figure 1.
3 JSP Models
In the design of Java Web applications, there are two commonly used design models,
referred to as Model 1 and Model 2.
Websites Based on J2EE of Struts 33
5 Conclusion
The advantages of using Struts to realize the website construction: It adopts JSP
marked mechanism to get the reusing codes and abstract codes. This method
contributed to improve the reusability and flexibility of codes. When the technology
space or the problem space varied, users have much more chances to reuse codes.
Using open source, everybody in the user’s room could check up codes. Struts make
the designers and developers pay their attention to their own favorite aspects.
Adopting separately control ideology to manage the problem space. The websites
based on this pattern had perfectly robustness. The layer structures were clear. As to
huge scale of system, Struts conducted to manage complicated system.
The disadvantages of using Struts to realize the website construction: The
applicable scope of Struts is limited. Struts are MVC solution based on web. So it
must be achieved by HTML, JSP document and Servlet and use J2EE application
program to support Struts. Struts need to support JSP1.1 and Servlet 2.2 standard
Servlet container. Of course, isolating the problem scope, but strengthening the
complicacy, so one must accept some training before they adopt Struts development.
References
1. Selfa, D.M., Carrillo, M., Del Rocío Boone, M.: A database and web application based on
MVC architecture. In: International Conference on Electronics, Communications and
Computers, pp. 48–49 (2006)
2. Lin, Y.-L., Hu, J.-P.: Design and implementation of the internet service platform for
rural house building technique criteria and management based on .NET MVC. Applied
Mechanics and Materials, 1727–1731 (2011)
3. Wang, L.-H., Xi, M., Li, D.-X.: A network-friendly architecture for Multi-view Video
Coding (MVC). Advanced Materials Research, 678–681 (2010)
4. Li, J.-M., Ma, G.-S., Feng, G., Ma, Y.-Q.: Research on Web Application of Struts
Framework Based on MVC Pattern. In: Shen, H.T., Li, J., Li, M., Ni, J., Wang, W. (eds.)
APWeb Workshops 2006. LNCS, vol. 3842, pp. 1029–1032. Springer, Heidelberg (2006)
36 C.-L. Jiao and J.-P. Wang
5. Xu, C.-W.: Applying the MVC diagram for building web applications in struts. In:
Proceedings of the 2005 International Conference on Internet Computing, pp. 38–44
(2005)
6. Li, Y., Chen, Q.-J.: MVC mode-based mobile telerobotic system and its java
implementation. In: Proceedings of the World Congress on Intelligent Control and
Automation (WCICA), pp. 4736–4740 (2004)
7. Zhang, Z.-Q., Xu, C.-J.: MVC model based on high-performance computing operating
audit system. In: International Conference on MultiMedia and Information Technology,
pp. 241–243 (2010)
8. Zhang, H.-T., Duan, F.-J., Wang, X.-Y.: Application framework of embedded system
based on MVC design pattern. Journal of Harbin Institute of Technology, 166–168 (2009)
9. Chen, N.: Automatic generation of resource access code based on MVC mode. Journal of
Shenyang University of Technology, 417–422 (2010)
10. Cui, W., Huang, L., Liang, L.-J.: The research of PHP development framework based on
MVC pattern. In: International Conference on Computer Sciences and Convergence7.
Information Technology, pp. 947–949 (2009)