Application Development of JSP in e-commerce website development From: java060515 [add to my favorites] JSP separates webpage logic from Webpage Design and display in developing e-commerce websites, and supports Reusable Component-based design to enable Web-based applications. Program Development has become fast and easy. JSP business website page consists of HTML Code And the Java code embedded in it. The server processes the Java code after being requested by the client on the e-commerce website page, and then returns the generated HTML page to the browser of the e-commerce website. Java Servlet is the technical basis of JSP in the development of e-commerce websites, and the development of large-scale Web applications requires the cooperation of Java Servlet and JSP. JSP is easy-to-use and fully object-oriented with Java technology. It is platform-independent, secure, and reliable. It mainly targets all features of the Internet.
JSP pages can be contained in a variety of application architectures or models and can be used in a consortium composed of different protocols, components, and formats. JSP-based dynamic information publishing technology is an open and scalable standard for establishing dynamic web pages. No matter what creation tool is used, developers can use JSP pages to create portable web applications and run them on different web application servers.
In the development e-commerce website, the p processor creates and compiles servlets for each JSP file. The processor also generates two files for each JSP file:
(1) Java file: contains Java code that can be used for servlet;
(2) class file: compiled servlet. The JSP processor places the. Java and. class files under the directory servlets/pagecompile/jsp_file_path, where jsp_file_path is the directory path of the JSP source file. For example, if the JSP file is in WebSphere/appserver/samples/Web
The. Java and. class files are under the WebSphere/appserver/Servlets/pagecompile/WebSphere/APP server/samples/webbank directory .. The file name of the Java and. class files is the same. The processor uses a naming convention that includes adding underline characters and suffixes to JSP file names. For example, if the JSP file name is login. jsp, the generated file is _ login_xjsp.java and _ login_xjsp.class.
JSP is an extension of Servlet technology in the development of e-commerce websites. servlets and JSP are used together for complex web applications.
A good start in developing e-commerce websites to use Java for Web programming is to learn Servlet technology. Even if you plan to use only JSP pages in your web application, you still need to learn Servlet technology. In more complex web applications, JSP pages are only used for display, while JavaBeans and custom tag libraries are used to embed business logic. That is, you must be proficient in JavaBeans and custom tag libraries.
In the development of e-commerce websites, JSP files access beans or other components that can send generated dynamic content to the browser. Figure 5-1 illustrates the JSP access model. When the Web server receives a JSP file request, the server sends the request to the WebSphere Application Server. The WebSphere Application Server performs syntax analysis on JSP files and generates Java source files (compiled and executed as servlets ). Java source file generation and compilation only occur when the servlet is called for the first time, unless the original JSP file has been updated. In this case, the WebSphere Application Server will detect the updates and rebuild and compile the servlet before executing them. The browser requests a servlet (populatebeanservlet) through an HTML form on a web page. The servlet creates a databean instance named databean and calls the JSP file to send the content to the browser. The servlet example and JSP file example illustrate the JSP access model that enables content separation.
JSP is a relatively new technology and rarely used in China. However, in foreign countries, JSP is already a popular technology, especially for e-commerce websites, mostly using JSP. JSP should be the future development trend. Some big E-commerce solution providers in the world use JSP/servlet. IBM e-business is a well-known company. Its core is to use JSP/servlet web sphere. Another famous Western e-commerce software provider, intershop, its original products intershop1, 2, 3, and 4 occupy the main share of e-commerce software. Websites using PHP, such as Sina and chinaren, are not suitable for large-scale e-commerce sites due to some shortcomings of PHP, it is more suitable for some small commercial sites.
Author: Oppo shuangfeiyanzi-MENGLIAN blessing