jsp online reference manual

Read(22035) update time(2022-04-13)

The difference between jsp and javascript is still very big. JSP (full name Java Server Pages) is a technical standard advocated by Sun Microsystems and co-created by many companies that allows software developers to respond to client requests and dynamically generate Web pages in HTML, XML or other format documents. JSP technology uses Java language as a scripting language. JSP web pages provide an interface for the entire server-side Java library unit to serve HTTP applications.


JSP (full name JavaServer Pages) is a dynamic web page technology standard created by Sun Microsystems. JSP is deployed on the network server and can respond to requests sent by the client and dynamically generate Web pages of HTML, XML or other format documents based on the request content, and then return them to the requester.

JSP technology uses Java language as a scripting language to provide services for users' HTTP requests, and can handle complex business requirements together with other Java programs on the server.

JSP embeds Java code and specific changes into static pages, using the static pages as templates to dynamically generate part of the content. JSP introduces XML tags called "JSP actions" to call built-in functions.

Alternatively, you can create JSP tag libraries and use them just like standard HTML or XML tags. Tag libraries enhance functionality and server performance without being limited by cross-platform issues.

The JSP file will be converted into more original Servlet code by its compiler at runtime. The JSP compiler can compile the JSP file into a Servlet written in Java code, and then the Java compiler can compile it into binary machine code that can be executed quickly, or it can be directly compiled into binary code.

Tip: Before learning JSP, you may need to study the contents of "HTML Tutorial" and "Java Tutorial".

Let’s experience the first jsp program!

The first jsp program

Instance

<html>
    <head>
           <title>第一个JSP程序</title>
    </head>
    <body>
           <%
                  out.println("Hello World!");
           %>
    </body>
</html>

Run instance»

Click "Run instance " button to view online examples

Tips: Our jsp tutorial will help you learn jsp knowledge from basic to advanced. If you have any questions, please go to the PHP Chinese website jsp Community to ask your questions, and enthusiastic netizens will answer them for you.

jsp Features

  • Can easily and efficiently add dynamic web content in a templated manner.

  • JavaBean and tag library technology can be used to reuse commonly used function codes (designed components are easy to reuse and reduce duplication of work). The tag library not only comes with common built-in tags (JSTL), but also supports custom tags with extensible functionality.

  • Have good tool support.

  • Inherits the relative ease of use of the Java language.

  • Inherits the cross-platform advantages of Java and realizes "write once, run anywhere". Because there are many development platforms that support Java and related technologies, website developers can choose to develop JSP on the system platform that is most suitable for them; JSP projects developed in different environments can be successfully accessed on all clients.

  • The dynamic (the part that controls the changing content)/static (the part that does not need to change the content) areas in the page are combined in a scattered but orderly form, which can make people more Intuitively seeing the overall structure of the page code also makes it easy to separate the two parts of designing page effects and program logic (separation of appearance view and logic). This makes it easier to allocate personnel and leverage their respective strengths to achieve efficient division of labor and cooperation.

  • Can cooperate with other enterprise-level Java technologies. JSP can only be responsible for the presentation of data in the page to achieve layered development.

jsp advantages and disadvantages

Advantages

(1) Write once and run everywhere. No changes need to be made to the code other than the system.

(2) Multi-platform support of the system. Basically, you can develop in any environment on all platforms, deploy the system in any environment, and expand in any environment. Compared with the limitations of ASP, the advantages of JSP are obvious.

(3) Powerful scalability. From just a small Jar file to run Servlet/JSP, to multiple servers for clustering and load balancing, to multiple Applications for transaction processing and message processing, from one server to countless servers, Java has shown a huge vitality.

(4) Diversified and powerful development tool support. This is very similar to ASP. Java already has many excellent development tools, many of which are available for free, and many of which can run smoothly on multiple platforms.

(5) Support server-side components. Web applications require powerful server-side components to support them, and developers need to use other tools to design components that implement complex functions for web page calls to enhance system performance. JSP can use mature JAVA BEANS components to implement complex business functions.

shortcoming

(1) Like ASP, some of Java's advantages are exactly its fatal problems. It is precisely because of cross-platform functionality and extreme scalability that the complexity of the product is greatly increased.

(2) The running speed of Java is achieved by using class resident memory, so the memory it uses in some cases is indeed the "lowest performance-price ratio" compared to the number of users.

Content covered by this jsp tutorial manual

This jsp tutorial covers all jsp basic and advanced knowledge, including jsp syntax, jsp instructions, jsp action elements, jsp implicit objects, and jsp clients Introduction to relevant technical knowledge such as requests, jsp server responses, jsp form processing, jsp database, etc.

Tips: Each chapter of this tutorial contains many jsp examples. You can directly click the "Run Example" button to view the results online. These examples will help you better understand and use jsp.

Latest chapter


JSP 国际化 2016-10-17
JSP 调试 2016-10-17
JSP 异常处理 2016-10-17
JSP 表达式语言 2016-10-17
JSP 自定义标签 2016-10-17
JSP JavaBean 2016-10-17
JSP XML 数据处理 2016-10-17
JSP 连接数据库 2016-10-17