Js|servlet
Java servlet Technology and JSP technology enable Java server-side technology, currently they control the entire server-side Java technology market, and gradually become the standard for building commercial Web applications. Java developers like these technologies for a number of reasons, including: These technologies are easy to learn, write once, run everywhere (write Once, run Anywhere). More
Obviously Tomcat has these packages underneath, but it also needs to add this dependency to Maven dependencies introduction of Servlet start - Dependency> groupId>Javax.servletgroupId> Artifactid>Javax.servlet-apiArtifactid> version>3.1.0version> Dependency> introduction of Servlet end - introduction of JSP related start - Dependency> groupId>javax.servlet.jspgroupId>
multiple Web servers, you can use a free or inexpensive server and have him support servlets, which can significantly reduce costs.
Flexibility: Because Servlets is running on the Java platform, Servlets can easily be moved from one platform to another, resulting in a much greater flexibility because of the cross-platform nature of Java.
A
is used here, that's not good.
Target JSP to which the request was forwarded (HANDLEIT.JSP)Why the first request did not print out the "Welcome to Out page!" This sentence before jumping to judge the text?Because, using the Jsp:forward standard action, the buffer is emptied before forwarding, that is, all content that is written to the response before forwarding will be cleared out.If there is a good person, in the "Welcome to Out page!" After th
Java Servlet technology and jsp (the preferred choice for SUN enterprise-level applications) technology enable Java Server technology. Currently, they control the entire server-side Java technology market and gradually become the standard for building commercial Web applications. Java developers like these technologies for many reasons, including: these technologies are easy to learn, one-time writing, and
ServletContext
Application
ServletConfig
Config
Jspexception
exception
PageContext
PageContext
Object
Page
Note that PageContext encapsulates other implicit objects, even if has a pagecontext reference, and can get references to other implicit objects and get the properties of all scopes.JSP annotationsThe API of the servlet generated by the JSPOur main focus is on three key methods: J
elements 6 true7 Scripting-invalid>8 Jsp-property-group>9 Jsp-config>Ten Web-app>Ignore El in JSP:method One : Specify in Web. xml:1 Web-app>2 Jsp-config>3 Jsp-property-group>4 Url-pattern>*.jspUrl-pattern>5 el-ignored> //This flag indicates that the EL is ig
In the whole JSP world, they are not a standalone, and there are many server software supporting JSP. They are mainly used in the commercial field, the most important of which is Allaire Jrun, IBM Websphere and BEA Weblogic.
Allaire Jrun
Allaire's JRun is a Java engine with the widest applicability. It is used to develop and implement server-side Java applications written by Java
The Js|servlet servlet and JSP technology is the main technology used in Java Development server-side application, and is the standard of developing business application presentation end. Java developers like to use it for a variety of reasons, one is familiar with the Java language developers are easy to learn the technology, the second is the "write, run everywhere" concept into the Web application, the i
"Head First Servlets JSP" (Chinese version) Bb,ks BB, Su Yu, Lin Jian, China Power PressData interactionWeb browsers and Web servers: Interact with HTML data through the HTTP protocol.What exactly is MIME type?To an HTTP response:The value of the Content-type (content Type) response header is called the MIME type.The MIME type tells the browser what type of data to receive so that the browser can know how
Excerpt from: "Lightweight Java EE Enterprise Application" Third editionFor each client request, the Web server roughly needs to complete the following steps:1. Start a separate thread2. Use I/O stream to read the user's request parameters3. Parsing parameters from the request data4. Handling User Requests5. Generate Response Data6. Send request data using I/O flow to the client1, 2, 6 is universal, by the Web server completed, 3, 4, 5 There are differences, because different requests contain th
server uninstalls the Servet, for example, when the servlet has not been used for a long time ).
What are the implicit objects in JSP pages )? What are their respective types and functions?
Request --Reponse --Session --Application --Out --Page --Pagecontext --Exception -- it is valid only when the current JSP page is error page.Config --
What is the difference from
What are the running Modes of
configuration in
Assigning values to Objects
Provided ServletConfig when the servlet was first initialized
Provided ServletContext when the servlet was first initialized
To initialize the parameters Servletcontextlistener (Context Listener)Servletcontextlistener is able to listen to a context initialization event so that it can get context parameters and run some code before the app provides services to the customer.Just as you tell the Web container
The main manifestation at two points1. JSP is a class servletJSP simple point is to use another set of simple rules written by the servlet program, it can write Java code, can also write HTML code, JAVASCRIPT,CSS and so on ..., However, the server side is first turned into a servlet program and then executed in the order in which the servlet executes.JSP is a simplification of servlets, the use of
Servlets and jsp (preferred for SUN Enterprise Applications) Development Principles (II)
Do not re-invent the wheel. Do not start from scratch: Custom components can improve reusability, but custom components still need to write, test, and Debug programs. The problem is that someone else may have done this, and your implementation method is not necessarily better than others. This isJsp (prefer
1, El's English is expression Language, translated into Chinese is "expression language." This is a scripting language for front-end programmers, and El does not have a "big difference" compared to Java expressions, and it seems somewhat "superfluous" to the backend programmer.2, however, We can not force every front-end programmer to learn Java,el compared to java, the cost of learning is lower and easier to understand.3, in the previous written code
implementation and pass it through the Chain.dofilter () call to the servlet. And this custom implementation must also include a custom output stream, as this is our goal, and the filter can get this output after the servlet writes the output and before the output is returned to the customer.
Disadvantage: Complex httpservletresponse interfaces need to be implemented, but usually not.
To achieve their own httpservletresponse too responsible, how to do? --servlet Packaging DeviceCr
particular protocol to handle the secure transmission. (The HTTPS protocol on top of SSL is practically always used.) )Data protection has some overhead and does not encrypt every request and response in your app, so use--conservatively and declaratively--to achieve data confidentiality and integrity:Data protection
Unauthenticated customer requests a restricted resource without a transmission guarantee
An unauthenticated customer requests a restricted resource, which is guaranteed
(ServletContext, HttpS ... ) is exactly the same as the property APIFor enumeration, see Java-enumeration Summary by IAMTJW5, the bad side of the property. •. ```.. ``.. `.`.`...`..
Context properties are not thread safe! A context property may be changed and accessed by multiple servlets at the same time. The bad solution is to add synchronized to doget (or other methods), which does not solve the problem because synchronized can only preve
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.