Every developer who uses servlets now knows that JSP is a Web technology invented by Sun and put a lot of effort into implementation and constructed on top of Servlet technology. JSPCodeThis can accelerate web application development and page
In the previous tutorial, we used Java. util. Date. Someone may ask: why not only use import java. util? In fact, the import statement can also be used in JSPs, but its syntax is somewhat different from that of common Java. The following is an
Source: If you have any copyright issues, please contact us
Basic Components
JSP has the following nine basic built-in components (corresponding to the six internal components of ASP ):Request client request, which contains parameters from the
Author: Builder. com
JSP provides many simple and practical tools, including reading data from the database, sending data, and displaying the results in a pie chart. Now let's take a look at this simple and practical method.
What you need
defaultroot
debugjsp
added to compile JSPs with debug info
org. Apache. Jasper. servlet. jspservlet
classdebuginfo
true
3
debugjsp
*. jsp
Copy to the WEB-INF/Web. XML in your application;
3. Copy style. xml and button. xml
I. Basic concepts:
1. Tag ):
A tag is an XML element. A tag can simplify and maintain a JSP webpage, and supports multiple language versions for the same JSP file. Because tags are XML elements, their names and attributes are case sensitive.
A web project does not have a web. xml file. That is to say, the Web. xml file is not required by the web project.
So when and when?To answer the above question, you must first understand what the web. xml file is used. The Web. xml file is used
1. jsp
Code :
Copy code The Code is as follows: Document: Application
Created on:, 13:18:53
Author: Lucifer
-- %>
Http://www.w3.org/TR/html4/loose.dtd>
JSP page
Get server info:
Get context path:
Get real path:
2. output: copy
1. Create a database and ODBC Data Source
1. Create a jcc. mdb database and user table2. Add Test Data3. Configure the ODBC Data Source
2. Under /, create the Access database connection file Select. jsp.
Select. jsp source code is as follows:
Try
Introduction:
Let's compare two large websites:
51job and Zhaopin (first, I declare that I am not making advertisements for them. I only use them as an example for technical comparison)
51job uses a relatively "advanced" php technology, while
Text/bingo_ge
Using proficiency, proficiency, familiarity, and understanding in this article marks your mastery of a technology.
Proficient: 85% or more technical points of the technology, more than two years of use of the technology, and the use of
Today I have nothing to worry about. I suddenly thought of a problem. Can I replace the suffix for accessing JSP files with my own suffix? After some debugging, I finally succeeded. Hahaha. So happy .....First, configure testsuffix mytest.
Summary
When programming for server components, you may need to obtain the actual path of a file from the path relative to the web root, but this file is actually on a virtual path of the site.
What is a virtual path?
On a web server, the virtual
XML (Extensible Markup Language) may look like a W3C standard-there is no real impact now, even if it can be used in the future, it will be a long time later. But in fact, it is now applied. Therefore, do not use XML until it has been added to your
In three steps:
1. Create a folder named tlds under the WEB-INF, and then create a tld file, such as formatTime. tld, the content is:
Copy codeThe Code is as follows:
Http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd>
1.0
1.1
ntuc
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