JSP Servlet provides an excellent platform for WEB application developers. However, most JSP Servlet-based development in China is currently in the most basic state, with a low code reuse rate and low development efficiency, and cannot meet the requirements of large-scale and complex WEB development.
First, to implemen
1. RequestDispatcher. forward ()
Is used on the server. When forward () is used, the Servlet engine transmits the HTTP request from the current Servlet or JSP to another Servlet, JSP or common HTML file, that is, your form is submitted to.
What JSP? What is the relationship with Servlet? JSP is an extension of Servlets technology. Everything that JSP can do can be done by Servlet. However, JSP allows you to easily mix Java code with the HTML language and complete po
JSP details-Servlet (2)Servlet development 1. Servlet Creation
Servlet creation is simple. There are two main methods: one is to create a common Java class to inherit from the HttpServlet class, and register the Servlet object in
Is your J2EE application running slowly? Can they withstand rising traffic volumes? This article describes how to develop high-performance and highly elastic JSP pages and Servlet performance optimization technologies. It means to build as fast as possible and adapt to the increasing number of users and their requests. In this article, I will lead you to learn the proven performance Adjustment Technology, w
Is your Java application running very slowly? Can they afford to keep up with the rising traffic? This article describes the development of high-performance, highly resilient JSP pages and the performance optimization of the servlet technology. The idea is to build as fast as possible and adapt to a growing number of users and their requests. In this article, I'm going to take you through the performance tu
Simply put, Sun first developed the servlet, its function is relatively strong, the system design is also very advanced, just, it output HTML statement or use the old CGI way, is a sentence output, so, writing and modifying HTML is very inconvenient. JSP is essentially a servlet, but the two are created differently.servlet is completely java program Code compo
The publishing process of a Web application
1. Deploy HTML files
Add the index.htm file to the helloappdirectory.
2. Deploy JSP
Common JSP files, under the helloapp directory.
3. Deploy Servlet
(1) create a Servlet File. It can call the getparameter method of the httpservletrequest object to read the loginform data s
Data sharing between JSP and servlet (data passing and invocation of data) (1) JSP (page) passes data to the servlet in the most common way: using form parameters or URL hyperlink parameters to implement data delivery (previously mentioned).
(2) The servlet passes data to th
JSP + Servlet + JavaBean to implement detailed login page instance, servletjavabean
This document describes how to use JSP + Servlet + JavaBean to log on to the web page. Share it with you for your reference. The details are as follows:
Four files are involved:
1. logon page: login.html2. login successful welcome page:
1. requestdispatcher. Forward ()
Is used on the server. When forward () is used, the servlet engine transmits the HTTP request from the current servlet or JSP to another servlet, JSP or common HTML file, that is, your form is submitted to.
the two ways of ? The forward method of RequestDispatcher is equivalent to the function of 18, talk about the role of the servlet listenerThe servlet listener listens for specific events and executes the listener's code when these events are generated. The application can be loaded, unloaded, the session initialization, destruction, the session value changes and other events to listen. --------------------
build automatically after modifying the JSP file, point "save" will not be automatically compiled into Tomcat:8.Servlet Output Current TimeRight-click on the SRC directory to create a new Servelet file:You need to fill in the package name and the servlet name name, the default is inherited from HttpServlet, the default check Doget and Dopost and other methods do
and access: 8080 in IE. If you see the welcome page of Tomcat, the installation is successful.
Step 3: Create your own JSP app directory1. Go to the webapps directory of the tomcat installation directory, and you can see the Tomcat built-in directories such as root, examples, and tomcat-docs;2. Create a directory named MyApp under the webapps directory;3. Create a directory WEB-INF under MyApp, note that the directory name is case sensitive;4. Create
js|servlet| Display
Because it has been not believed that Java can not mix to display a number of languages of the bug, this weekend to study the servlet, JSP in the multinational language display problem, that is, the servlet's multiple character set problem, because I am not very clear on the concept of character set, so the writing is not necessarily accurate
1. understanding of basic concepts
Absolute path: the absolute path is the real path of the file or directory on your home page on the hard disk (URL and physical path), for example:C: XYZ est.txt represents the absolute path of the test.txt file. Http://www.sun.com/index.htmalso represents a urlabsolute volume.
Relative Path: the path relative to a base directory. Contains the relative path of the Web (relative directory in HTML), for exampleIn servlet
answer received from the servlet to the client.Servlet Program Implementation:Web. XML Configuration servlet:Servlet life cycle:The life cycle includes:Loader, initialize, service, destroy, uninstall. The corresponding HttpServlet methods are: Init () \init (servletconfig config), service, Destory.Servlet Jump:Client Jump: Use Httpservletreponse's SENDREDIRCT (), but this jump can only pass properties of session and application scope.Server jump: Rel
Is your Java application running very slowly? Can they afford to keep up with the rising traffic? This article describes the development of high-performance, highly resilient JSP pages and the performance optimization of the servlet technology. The idea is to build as fast as possible and adapt to a growing number of users and their requests. In this article, I'm going to take you through the performance tu
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.