Introduction to JSP development (i)----Install your machine to use JSP
You will need the Java 2 Software development tool (JSDK), its original name is the Java development tool (JDK) and the JavaServer Web site development tool (JSWDK), Tomcat, or
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
Now have a lot of novice JSP users will often ask the database how to connect ah, how old mistakes ah? So I concentrated in this write an article for your reference, in fact, this database logic all put in the JSP may not be a good practice, but is
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,
1, the MySQL limit keyword (DAO)
SELECT * FROM tablename limit startpoint, numberperpage;
TableName is the name of the table to be paged;
StartPoint is the starting position-1;
Numberperpage is the number of bars displayed on a page.
For
The jsp:plugin Action enables you to insert the object or EMBED element of the specific browser you want to specify the plug-ins that the browser needs to run a Java applet.
Syntax:
[Name= "InstanceName"]
[archive=
There are not many opportunities to use COM components in JSP programs, and JSP does not directly operate COM functions, but some work must also use COM components to complete, the following is the specific method of operation.There are two ways to
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:
1. Requestdispatcher.forward ()On the server side, when using forward (), the Servlet engine passes HTTP requests from the current servlet or JSP to another servlet, JSP, or normal HTML file, or your form to a.jsp, The forward () redirect to b.jsp
1.JSP Code:
Copy Code code as follows:
Document:application
Created on:2009-10-4, 13:18:53
Author:lucifer
--%>
"Http://www.w3.org/TR/html4/loose.dtd" >
jsp page
Get Server Info:
Get context Path:
1. Join in the XMLHTTP request with no refresh request
var Http_request=false;
function createrequest (URL)
{
Http_request = false;
if (window. XMLHttpRequest) {//Mozilla, Safari,...
Http_request = new XMLHttpRequest ();
if
1. Requestdispatcher.forward () is on the server side, when using forward (), the Servlet engine passes HTTP requests from the current servlet or JSP to another servlet,jsp or normal HTML file, or your form commits to a.jsp, The forward () redirect
Data save, update, and delete:
1, Session.save () method:
The Session.save () method is used for persistent storage of entity objects, which means that when the Session.save () method is executed, the corresponding insert SQL statement is generated,
The software used in this experiment is the myeclipse10,tomcat7,dreamweaver,sqlserver2008 database. You can implement a user login with a user name and password. If the login succeeds, the page displays the login success, and if the password 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