The life cycle of the servlet:
1, the container starts, will read the Conf/server.xml file, to determine the boot port and Web application storage path
2. Web container startup reads the Web.xml file configuration information for each Web
what is JSP. Jsp:java server Pages, which is fundamentally a simplified servlet design, implements the use of HTML tag JSP in Java as a Dynamic Web-page technology standard and a JEE standard JSP, like the servlet, is executed on the server side
JSP
In the development of JSP, iterations are the operations that are often used. For example, the results of a query are displayed on a line-by-row basis. In earlier JSPs, scriptlets was often used to implement iterative output of iterator or
1. Through the background query, find the corresponding number of pictures back to the foreground, as follows for the background returned images array
">
pro/table1/${ite} ">
2 Pass the parameters (picture path) of
In a Web project, pass parameters to another JS file from a JS file
1, first JS file to add the parameters to the second JSP URL behind, this way the parameters to the second JSP, such as the following code:
2, in the second JSP through the
Commodity entity class design
Examples of commodities here are books. We will build it as a JavaBean class to improve the reuse of code and the maintainability of the program. Here's a little trick to quickly add a lot of setters and getter:
Environment: Eclipse Mars
1. New Dynamic Web
2, new JSP page, code:
hive Query Statement
query Statements:
3. New Servlet
Package com.kuaiya.query.process;
Import java.io.IOException;
Import
When the user exits the system, if you reopen the page after the login, you should jump to a page that prompts the user not to sign in, which is easy to do, as long as the head of the JSP page plus the validation session code can be. However,
JSP has the following 9 built-in objects:
Request : represents the HttpServletRequest object, client requests. It contains information about browser requests and provides several useful methods for obtaining cookies, headers, and session
use of C tags in jsp
Core Tag LibraryIt is the core library in Jstl, providing common support for day-to-day tasks, such as displaying and setting variables, reusing a set of projects, testing conditions, and other actions such as importing and
1: Use Jstl tags (can be used with custom tags)
First refer to Jstl label
Then use the foreach label
${user. Pid}
${user. Ploginname}
${user. Pusername}
${user. Pemail}
You can use and to
Why JSP pages are static.
The so-called JSP page static refers to the dynamic JSP page generated static HTML page, through the direct access to the generated HTML to obtain and access JSP the same display content and application functions.
JSP or
Many beginners are always confused about the relationships and differences between JavaScript, Java, JSP, and J2EE. To help you quickly understand the relationships between several users, we have explained the following:
1. Javascript is used to
Constructor
Differences between constructors and MethodsSummaryTo learn Java, you must understand the constructor. The constructor provides many special methods, which are often confusing for beginners. However, there are many important differences
The JSP (Java Server Pages) introduced by Sun is a dynamic web page development technology executed on the server, which is based on Java technology. When executing JSP, you need to set up an engine for compiling JSP web pages on the web server. You
Basepath in JSP (this article is reprinted articles, articles reprinted from http://blog.csdn.net/lutinghuan/article/details/6450174)
The following code is automatically generated on the new JSP page of Eclipse:
String Path = request. getcontextpath
Modify the src attribute of an image and assign a value to it to refresh the image,
However, due to the cache issue, if both values are the same, the browser generally does not refresh the image. Therefore, you need to make no changes to the image
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.