I have just completed such a similar system in the last two days, and I hope to discuss with you the technology of JSP implementation.
Sina Sohu Such a system should be similar, is the background dynamically generate foreground HTML page, no matter
(iv) Tomcat
1, with WinZip, such as decompression software to Tomcat.zip to a directory, I unzipped it to C:\, it will automatically
Create Tomcat subdirectories, so that in the C disk more than a directory c:/tomcat, I use $tomcat logo;
2, open
(ii) Apache Server
1, double-click the Apache_1_3_12_win32.exe file for installation, install using the default configuration, the default installation directory is:
C:\Program Files\apache Group\apache, I use $apache_root to replace the
This article only discusses how to install apache+servlet+jsp on Windows NT 4.0. The configuration in this article is as follows:
Windows NT 4.0
Jdk1_2_2-001-win.exe
Apache_1_3_12_win32.exe
ApacheModuleJServ.dll
Tomcat.zip (3.0)
A. Software
Recently done in the DRP project, the use of JSP to operate Chinese, often there will be some garbled problems. These problems result in Chinese being unable to enter or are not displayed properly. This involves the setting of the character set and
Package coreservlets;
Import java.io.*;
Import javax.servlet.*;
Import javax.servlet.http.*;
/** Sets six Cookies:three that apply
* Session (regardless of how long, session lasts)
* and three that persist for a hour (regardless of
* Whether
Words not much to say, directly on the example
Insert
Copy Code code as follows:
String sql= "INSERT into allorder values (' + orderid +" ', ' + BookID + "', ' + Amount +" ', ' "+ Username +") ";
int result=stmt.executeupdate (SQL);
The rapid development of Java Server Pages (JSP) from the server-side facilitation program has made it a popular tool. Although the inflexible side still exists, however many drawbacks it contains, JSP can provide a lot of things for web programmers,
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.
Code fragment in action
Copy Code code as follows:
private string epid;//global variable gets a comma-delimited string
Public String Getepid () {
return epid;
}
public void Setepid (String epid) {This.epid = Epid;}
Public
First, the preface
The original author of this article is Tony Wang, which covers the reading and writing of files and the automatic generation of JPG images. Using Jsp+servlet technology, the JSP calls the servlet to generate pictures.
Second,
JSP to go through the "code" two times, the first phase will use Pageencoding, the second phase will be used Utf-8 to Utf-8, the third stage is from Tomcat out of the Web page, with the ContentType.About the differences between the pageencoding and
What are servlet and JSP
There are two main technologies used to develop Web applications in Java, namely, Servlet and JSP. A servlet is a Java program that executes on the server side, and a program called a servlet container (in fact, a server)
This section describes the two interfaces ServletContext and ServletConfig. Through these two interfaces, we can set some parameters in the Web.xml, such as database address, username password, etc. for the servlet to use, so that each parameter
In projects, we often encounter the need to pass Chinese characters in JSP page transitions. There are two main ways of doing this.
Url method
For example:
Http://website/test1.jsp?act=add&type= Apple ¶m=%20d%20b
Form mode
For example:
Today involves a problem, in the query criteria in the JSP, there are text boxes to enter filter criteria, there are drop-down boxes to select the filter criteria. The contents of the input box can be deleted by pressing the "Backspace" key, but the
Today, I reviewed the JSP instruction element section, sorted out, and shared with you:
One, page instruction:Sets the global properties of the JSP page, which acts on the entire JSP page, setting including statically contained files.
1, Language
In doing JSP upload pictures, the Java code directly into the JSP, upload the following exception:
2012-12-31 8:59:21 Org.apache.catalina.core.StandardWrapperValve Invoke
Serious: Servlet.service () for Servlet JSP threw
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