Discover java servlet jsp cookbook, include the articles, news, trends, analysis and practical advice about java servlet jsp cookbook on alibabacloud.com
This series of related content, is accumulated in these two years, this time to organize into a web version, on the one hand to share to everyone, on the other hand also convenient to consult.This section describes basic Web server-related aspects of SSH, including JSPs and Servlets.The first part, overviewThis series of related content, is accumulated in these two years, this time to organize into a web version, on the one hand to share to everyone, on the other hand also convenient to consult.
JSP is the extension of the servlet, before the JSP, there has been the servlet technology. The servlet uses output streams to dynamically generate HTML pages, including each HTML tag and each content that appears in an HTML page.
The development efficiency of the
JSP compiled into Servlet (3) JSP compiled Servlet
What is the Servlet class after JSP compilation? What are the mappings between them? When discussing the relationship between JSP and
transferred to Servlet classes.
◆ Request period: After the Servlet class is executed, the response is sent to the client.
During the translation, two things were done:
◆ Translation period: Transfers JSP pages to Servlet Source Code. java.
◆ Compilation period: Compile
inherits from HttpServlet ). This attribute is rarely used.
IsErrorPage attributesSets whether the JSP page is an abnormal page. This attribute must be used with errorPage.
Language attributesSpecifies the language syntax used by the container to translate JSP pages. However, currently, only Java syntax is used and the default syntax is used.
Session attributesS
environment will achieve good performance.
Ptt3: Controls httpsessionMany systems require a series of client requests so that they can be associated with other systems. At this time, Web-based applications need to maintain a state, which becomes a session, because the HTTP protocol is stateless. To support the State that must be maintained by the system, java servlet provides APIs to manage sessions and
Js|servlet JSP and Servlet
The main purpose of this article is not simply to introduce JSP, nor is it a detailed introduction to the servlet. This is a basic article about the relationship between JSP and the
The servlet and JSP specification versions correspond to the relationship:
Servlet Spec Version
JSP version
JSF version
JAVA EE version
Servlet2.3
JSP1.2, JSP1.1
j2ee1.3
Servlet2.4
JSP2.0
Servlet learning notes (7) -- JSP overview, servlet learning notes1. servlet has two defects: ① All HTML tags must be included in Java strings, which makes sending HTTP responses very complicated; ② All text and HTML tags must be hardcoded, even if you make minor changes to
: 8080/MyApp/index. jsp to view the current time.
Step 4: Create your own servlet:
1. Use the editor you are most familiar with (it is recommended to use Java ide with syntax check) to create a servlet program named test. java. The file content is as follows:
Package test;Im
//en" Welcome to the online store Welcome Welcome,!--first-time user named "New user"-->To set account information, please click here The rest of the page ...
Here is a simple comparison of JSP and other similar or related technologies:
JSP compared to active Server Pages (ASP)
Microsoft's ASP is a technology similar to JSP. There are two advantages to
Compared with ASP and PHP, Servlet/jsp has a high execution efficiency due to its multi-threaded operation. Because Servlet/JSP is executed in multi-thread mode by default, You need to carefully consider the multi-thread
SecurityProblem. However, many developers have not noticed the multi-thread security issue when wri
classes are used).
Finally, Doget and Dopost are called by the service method, and sometimes you may need to cover the service method directly, such as when the servlet handles get and post two kinds of requests.
3.2 Simple servlet for output plain text
The following is a simple servlet that outputs plain text.
3.2.1 Helloworld.java
Package Hall;
Imp
JSP cannot be accessed directly through a browser. It must be redirected through servlet. However, the
Today, when doing the job encountered a problem, before we write jsp code is put under the webcontext directory, not put in its subdirectory under the WED-INF directory, all lead to the browser can directly access jsp
javaweb--in-depth servlet and JSP (operating principle)Review Review!!! Get Up!! Servlets and JSPs are the most basic members of the Java EE specification, and they are a key knowledge of Java Web Development, even though we often use frameworks to develop the backend, but we still need to understand their principles.
initialization process, such as a connected database.Servlets are platform-independent. As mentioned earlier, the servlet is written in Java and naturally inherits the platform independence of Java.The servlet is extensible. Since the servlet is written in Java, it has all
Now JSP books are some of the direct use of the JSP, and then explain the use of serverlet, there are books on the use of Serverlet, and then explain the use of JSP. I think the second kind of relatively good, as for the reasons we can learn to experience! So today we continue to learn the use of Serverlet!Okay, cut the crap, start now!
What is a
now JSP books are some of the direct use of the JSP, and then explain the use of serverlet, there are books on the use of Serverlet, and then explain the use of JSP. I think the second kind of relatively good, as for the reasons we can learn to experience! So today we continue to learn the use of Serverlet!Okay, cut the crap, start now!
What is a
today 's JSP books are some of the direct use of the JSP, and then explain the use of serverlet, there are books on the use of Serverlet, and then explain the use of JSP. Personally feel that another kind of relatively good, as for the reasons we can learn to understand! So today we continue to learn the use of Serverlet!Okay, cut the crap, start now!
What
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.