Let's take a look at jsp and try to understand it later.
Based on the principles of learning jsp together with everyone, let's talk about jsp today.
First of all, JSP (called assumerver Pages) is a kind of process proposed by Sun Microsystems and jointly created by many companies so that software developers can respond to client requests, the technical standards of Web pages that dynamically generate HTML, XML, or other Format documents. JSP technology uses Java as the scripting language. JSP web pages provide an interface for the Java Library Unit on the server to serve HTTP applications. Web applications developed using JSP are cross-platform. They can run both on Linux and other operating systems.
1. a JSP page can be divided into the following parts:
(1) static data, such as HTML
(2) JSP commands, such as include commands
(3) JSP script elements and variables
(4) JSP action
(5) User-Defined tags
2. Basic principles of JSP:
Jsp is essentially a servlet. Jsp embeds java code in the standard HTML page. The static part of jsp does not require Java program control. Only those that need to be read from the database or need
The dynamically generated page content is controlled using Java scripts.
Jsp page content:
> Static part: standard HTML tags and static page content, which are the same as static HTML pages.
> Dynamic part: Content controlled by Java programs, which is controlled by Java programs.
Note: The nature of JSP is still servlet. Each JSP page is a Servlet instance-the JSP page is systematically compiled into a Servlet, And the Servlet is then responsible for responding to user requests.
How JSP works:
Client → send request → JSP Server (if the JSP page receives the request for the first time, compile the JSP file and generate the corresponding Servlet. If the JSP page already has the corresponding
Pipeline returns the Servlet of the standard HTML page pipeline, which dynamically generates the standard HTML page according to the request. Note: HTML documents are dynamically generated based on requests each time .)
1. JSP files must be run on the JSP server.
2. JSP files must generate servlets for execution.
3. The first visitor to each JSP page is very slow, because the JSP must be compiled into a Servlet.
4. The visitor of the JSP page does not need to install any client, or even the Java runtime environment that can be run, because the JSP page is delivered to the client as a standard HTML page.
3. JSP optimization:
(1). Separate content generation and display
(2 ).Reusable components
(3 ).Use Id
(4 ).Adaptive Platform
4.
Strong Technology
(1) Write it once and run it everywhere. The Code does not need to be changed except for the system.
(2) multi-platform support of the system. It can be developed in any environment on all platforms, deployed in any environment, and expanded in any environment. Compared with the limitations of ASP, JSP has obvious advantages.
(3) Powerful scalability. From only one small Jar file to Servlet/JSP, to cluster and load balancing by multiple servers, to transaction and message processing by multiple applications, one server to countless servers, Java shows a huge vitality.
(4) diversified and powerful development tool support. This is similar to ASP. Java already has many excellent development tools and many of them can be obtained for free, and many of them can run smoothly on multiple platforms.
(5) supports server components. Web applications require powerful server-side components. developers need to use other tools to design complex functional components for web page calls to enhance system performance. JSP can use sophisticated java beans components to implement complex business functions.
Technical weaknesses
(1) The same as ASP, some advantages of Java are the same as their fatal problems. It is precisely for the purpose of cross-platform functionality and extreme scaling capabilities that greatly increase the complexity of the product.
(2) Java uses the class resident memory to run at a speed. Therefore, in some cases, the memory used by Java is indeed the "lowest performance-price ratio" compared with the number of users.
5. Simple small jsp instance:
<Html>
<Head>
<Title> FirstPage </title>
</Head>
<Body>
<P> This is my first jsp page. Please take care of it. </p>
</H3>
</Body>
</Html>.
Note: Put this file and all your HTML and JSP pages in the webpage directory under your JSWDK installation directory. you can go to http: // localhost: 8080/sample. jsp download this page. when you visit this webpage for the first time, the website server will translate the JSP into the assumervlet program code, then you will see the date and time.
6. Comparison of C/S and B/S software technology
C/S
Structured Software (Client/Server mode) is divided into two layers: client and server.
Computing power input and output devices,
It is said that it has certain data processing and data storage capabilities,
By
Computing and data are reasonably distributed at both ends of the client and server,
This effectively reduces network traffic and server computing workload.
Due to restrictions on the number of server connections and data communication volume,
Software with this structure is suitable for a LAN with a small number of users
. Most of the current domestic
ERP (financial) software products belong to this structure.
B/S (Browser/Server mode)
With the rise of Internet technology
Structure Improvement. In this structure, the business logic of the software application is fully implemented on the application server, and the user performance is completely
Web server implementation,
The client only needs a browser for business processing,
Is a brand new software system construction technology. This structure
It has become the preferred architecture for today's application software.
7. Future Prospects of jsp
JSP should be the future development trend. Some of the world's leading e-commerce solution providers use J
SP/Servlet. Well-known E-business of IBM, whose core is WebSphere with JSP/Servlet;
Another famous Western e-commerce software provider, Intershop. Its original products Intershop1 2, 3
, 4 occupies the main share of e-commerce software. They are all supported through CGI.
The moment of your epiphany is just a growth. --- Mr. chic