JSP page Element composition
JSP page components are: Directives, comments, static content, expressions, small script, declaration.
JSP directives
Page instruction: typically at the top of a JSP page, the same page can have multiple page
This article describes the JSP implementation of adding functionality and paging display methods. Share to everyone for your reference. Specifically as follows:
Learning objectives:
① further grasps the MVC design pattern;② Mastering the
Pre-run preparation
Recommended a MS SQLServer7 database DNS, named: test_db
There is a table in the Database: Guestbook field: Name (varchar), email (varchar), body (text)
The database user is null for the SA password and can be modified by
jsp Bean example
Write the current value of is the property count
Out.println ("Count from Scriptlet Code:"
+ counter.getcount () + "");
%>
Count from Jsp:getproperty:
11.1 Overview
JavaServer pages (JSP) allows us to separate the static HTML and dynamic parts of the page. HTML can be written in any commonly used Web authoring tool and written in the same way as the original, where the code for the dynamic part
First, what is JSP
JSP (JavaServer pages) is a Dynamic Web page technology standard, which is initiated by Sun Microsystems Company, and is built by many companies, and its Web site is http://www.javasoft.com/products/jsp. Adding Java program
Using scripts
In some places, you probably want to add some good, mature program to your JSP page, JSP label although very powerful, but the completion of some work is more difficult. You can then use the Scripting Language section to supplement the
This article describes the JSP to achieve a simple user login and display the user information method. Share to everyone for your reference. The implementation methods are as follows:
login.jsp
Copy Code code as follows:
Vishal_donth gave this response on 10/18/2000:
These are are imported from
Java Mail
The Java Mail PAckage either be dowloaded
seperately
Or else is Available in the j2sdkee1.2
(Java Enterprise Edition)
Import javax.mail.*;
Import
1.request.getrequestdispatcher () is a request forwarding, front and back page sharing a request;Response.sendredirect () is redirected, and the front and back pages are not a request.
2.requestdispatcher.forward () is running on the server
JSP rendering under IE9 may be blocked by alert. There is no problem with the IE8.
Problem Description:
A JSP that uses jquery to bind the scene initialization event (function ()), with alert () in the initial event.
IE8 the instant the
The counter is the general website Essential Dongdong, do not underestimate it, each time stationmaster looks at the small counter the numeral to grow rapidly, the feeling is very great. We used CGI, ASP to write counters, this article a lot of,
There are two minor exceptions to sending to the client intact:
1. If you want to transfer , because it is consistent with the special symbols of the JSP, you must use the Escape word escape, 2. If you want to send a comment that appears in the JSP
Previously, we have mentioned that JSP programs are modules and have powerful expression-request (presentation-request) capabilities. Creating a perfect database access is a challenging process, and the JDBC interface is a good way to do this.
After a period of experiments to ponder, and finally the parameters between the front and back of the pass is done, the experiment tools myeclipse+structs1.2.
Summary: Error-prone places: The format of data in 1.ajax must be written to the right,
Java Get server time, dynamic display to JSP page, everyone is to Java can only get once, to the page time is static, but through the cooperation of JS and Java, cleverly realize this function.
I am to do the system for television, customer
Jumps between pages can be achieved in two ways: forward and sendredirect.Forward: can be used in JSP pages and can be implemented in a servlet.Use in a JSP page, such as to jump to userlist.jsp, to write:
Copy Code code as follows:
Double-click the JSP icon by file->new...->web-> to eject the dialog box that created the JSP Wizard, as shown in the following illustration:
Figure 3 Creating login.jsp with wizards
· Web module: If there is more than one Web module
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