EquivalentBut there is also a difference: the two uses have different scopes, It can be used in multiple pages and Import = "Zero. Space. ch03.bookbean"/> can be used only for one page and cannot be called across pages.For example, if you include
I previously wrote a simple JSP for stress testing. I did not expect a problem that when the pressure is high, it will happen if the operation lasts for a long time, that is, the JVM memory is almost exhausted. You can use jprofiler to check that
Chinese garbled characters have plagued JSP
ProgramClerk, I often see this situation during programming;
After a piece of writing experience and absorbing his experience, the situation of "garbled characters in passing Chinese parameters through
I. Environment Configuration
First, add the driver to classpath.
1. storage location of the driver when connecting to MySQL:Driver name: mysql-connector-java-3.1.5-gamma-bin.jarPath: tomcat5.5/common/libIt takes effect after you restart tomcat.
The basic component JSP has the following nine basic built-in components (which can correspond to the six internal components of ASP ):Request: User-side request. This request contains the parameter string 4 from the get/POST request.
Response:
8) labels:Forward a request object. You can pass parameters. The target file must be able to process parameters.Before use, the JSP file has data, so the File Execution will fail.Attribute:-Page = "URL or expression" indicates the URL of the file to
If "relative path" is used in JSP, problems may occur.
Because the "relative path" in the webpage is relative to the "URL request address" to find resources.
What does the above sentence mean?For example:Assume that we have a project: MyAppUnder
Static JSP inclusion
Now let's take a look at the JSP static include command:
Create a project testinclude
Then add the file:
Index. jsp:
this is user's area
Curdate: (without a suffix)
curDate:
Curdate. jsp:
JSP standard tag library -- jstl
Jstl is a set of custom tag libraries that implement common functions in Web applications.
Jstl has five categories:
1. Core tag Library
2. internationalized/formatted tag Library
3. Database tag Library
4. xml tag
Declare valid variables and methods in JSP programs
JSP syntax
Example
Description
Declare the variables and methods you will use in the JSP program. You must do the same. Otherwise, an error will occur.
You can declare multiple variables
When talking about JSP program design, we should first understand the HTTP protocol.
1. Basic HTTP knowledgeHTTP is a hypertext transfer protocol and stateless protocol. It uses the default open port 80. The Browser needs to establish a connection
1. log on firstWww.fckeditor.net/downloadTo download the latest FCKeditor version, you need to download two packages: one is the basic application and the other is the configuration prepared for the JSP.
FCKeditor 2.6:
JSP reference (3) Directive element [direve VE]
descriptionThis command can only be used in tag files. It declares the attributes supported by the Tag file. Syntax[Required = "True | false"] [fragment = "True | false" | [type =
1. How to pass parameters between multiple JSP pages? Use the JSP built-in scope object session. Using its two methods setattribute (), getattribute ()
2. The following example implements the function of passing parameters of the first JSP page to
1. jsp is short for Java Server Pages.
2. Web applications developed using JSP are cross-platform.
3. JSP technology is an extension of Servlet technology. Servlet is a platform-independent Java Server Component of 100% pure Java.
4. The following
1. This instance mainly tells us how to use JSP actions in JSP code, for example,
2. This instance requires four files: login.jsp,test.jsp, OK .htm,no.htm
3. First, let's take a look at login. jsp.
Username
Password
4. The test. JSP
String agent = request. getheader ("User-Agent ");Stringtokenizer ST = new stringtokenizer (agent ,";");St. nexttoken ();// Obtain the user's browser nameString userbrowser = ST. nexttoken ();// Obtain the user's OS nameString useros = ST. nexttoken
The first thing I want to talk about is that AJAX cannot upload files. I can think about how AJAX can transfer files through passing strings to communicate with the background? In fact, JS cannot operate files for security reasons. Therefore, it is
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service