Queries to implement a database in a JSP page are mainly connected to the Java Code section of the database and the HTML page Code section. To implement this page, we go through a three-step
1, write the code to connect the database
2, write the
At work, the following similar section is often seen on the JSP page.Code:
Response. setheader ("cache-control", "No-Cache"); // HTTP 1.1 response. addheader ("cache-control", "No-store"); // Firefox response. setheader ("Pragma", "No-Cache"); /
Normal print (full page)
Print part of the content in the webpage (custom) print remove/Add the header and footer use external controls/methods to achieve multi-function printing print background
The above is code control
Set "page settings" to set
The following example shows how to use JavaScript to change the applet status and call the method in the applet in Javascript.
1. Applet source code (tmin_js2.java)
// ImportImport java. AWT. graphics;Import java. AWT. event;
// Liveconnect... for
This article mainly introduces how to use sysdeo eclipse Tomcat launcher plugin to edit and debug JSP and Servlet. It is best to first refer to my previous article "Illustration using eclipse3.0.1 + lomboz3.0.1 + tomcat5.0.28 to develop jsp" series,
How can a webpage written in JSP contain Chinese characters when passing parameters? 2011-06-21 17: 58 yuqiangdede
| Category: other programming languages | browsing 428 times
"> request in servelt. setcharacterencoding ("gb2312"); response.
I. Overview
In Web applications, the generation of some reports may take a long time for the database to calculate. Some websites provide weather information, which requires access to a remote server for soap calls to obtain temperature information.
I. jsp connection to oracle8/8i/9i Database (in thin Mode)
Testoracle. jsp is as follows:String url = "JDBC: oracle: thin :@ localhost: 1521: orcl ";// Orcl is the SID of your databaseString user = "Scott ";String Password = "tiger ";Connection conn
Of course, you must first create a table and corresponding columns for saving images in the database. The data format is blob.
package com.lizhe; import Java.io.*; import java.sql.*; public class PutImg { public void putimg() {
Some code has been commented out because it has an impact on other code during local debugging.
1. Redirection/Refers to 127.0.0.1,If not, add the specified Page name from akazamtest01.There cannot be two response. sendredirect ("")If the HTTP
In JSP code, java.net. urlencoder. encode () is used to encode the Chinese characters to be passed. However, the received string is garbled. The most frustrating thing is that this code runs normally on some machines, but it cannot run normally on
JavaIn recent years
JavaSe 5 and
JavaThe launch of Se 6,
JavaThe future is even more brilliant. However
JavaBasic
JSPIn
JavaSe 5 has been unable to lift its head before its launch. The most important reason is
JSPAlthough the function is very
ServletAnd JSP knowledge Review (2) servlet Basics
· Generate HTML Servlet
· Inform the browser of the HTML when the browser sends the message next
-Response. setcontenttype ("text/html ");
· Modify the println statement to build a valid Web
Now let's start our JSP and database journey.
I. jsp connection to oracle8/8i/9i Database (in thin Mode)Testoracle. jsp is as follows:String url =/"JDBC: oracle: thin: @ localhost: 1521: orcl /";// Orcl is the SID of your databaseString user
1. A server, a host in the network, which provides network services such as web and FTP.
2. During the request response process, if a static html webpage is stored on the server, the server will return the content in the webpage intact. If a dynamic
Document directory
2.4.1 open myeclipse
2.4.2 configure Tomcat path
1 JSP function sp can put Java code and HTML code in one file, which is a good way to develop dynamic websites.
2 install and configure myeclipse, JDK, and tomcat
Myeclipse
The original source code does not have a myeclipse project, the database uses sqlserver2000, and the server uses tomcat.
I put all the code in myeclipse10, deployed to Apache-Tomcat-6.0.35, the database uses sqlserver2008, found that the original
① Out-javax. servlet. jsp. jspwriter
The out object is used to output the result to the webpage.
Method:
1. Void clear ();
Clears the content of the output buffer but does not output it to the client.
2. Void clearbuffer ();
Clear the content of
1. Unzip and install the Jboss container and start it. Access http: // localhost: 8080/jmx-console. If it is displayed as normal, the Jboss container is successfully started.
2. If Jboss is installed in the root directory of the D Drive, enter
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.