Displayfile.java
//*********************************
File parentdirectory = null;//current directory
ArrayList [] File = null;//holds all files in the current directory
ArrayList [] directory = null;//holds all directories in the current
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
1. In the site (My site is: E:\javatest) under the establishment of the folder "Accessdb" and under the folder to establish a database "Test.mdb" and the Table "Stu", Stu Field Id,stuname test.mdb the path is: e:\ Under Javatest\accessdb
The
I. Establishment of databases and ODBC data sources
1. Establish Jcc.mdb database and user table
2. Add test data
3. Configuring an ODBC data source
Two. Under /, create a new Access database connection file select.jsp
Select.jsp source code is
Main principle please refer to http://blog.hunan2s.com/article.asp?id=233
After a turn of debugging, success. Oh
Attached source code.
JDK 1.5 +eclipse +tomcat 5.0.28 + MYSQL 5.0
Database test, table name News
Fields: ID int automatically grows,
Verify Sex (radio button validation)
function Checkxb () {
var temp = false;
var xbobj1= document.getelementbyid ("Xb1");
var xbobj2= document.getelementbyid ("Xb2");
if (xbobj1.checked | | xbobj2.checked) {
temp = true;
}
return temp;
}
function
1, on the page
Copy Code code as follows:
Value=/>
2.action
Copy Code code as follows:
string[] checkbox = request.getparametervalues ("checkbox");
list Checkboxs = new arraylist ();
int Operatorid
For example:
Copy Code code as follows:
Hibernatetest.java
Import onlyfun.caterpillar.*;
Import net.sf.hibernate.*;
Import net.sf.hibernate.cfg.*;
Import java.util.*;
public class Hibernatetest {
public static void Main (string[]
1, under Tomcat for the old domain to do a virtual host
Home page for index.jsp, 404 error page for unfind.jsp
Homepage uses 301 to turn, is advantageous to the search engine optimization
Response.setstatus (301);
Response.setheader ("Location",
Package com.shaccp.web.util;
Import java.util.List;
public class Pagebean {
/**
*
*
* @author ppy 2008-10-18 14:3:56
* Total Records of totalrecords
* List to save paging data
* PageNo Current Page
* PageSize Page size
* Query saves a string of user
It's not complicated to do trees, but we usually do 2 or 3 layers, and that data comes from more than one table, such as: Department, employee
Yet this self-contained table, which has no definite level, may be infinitely multilevel
For example: A is
dwr.jsp
a
b
c
Dwr.xml
Public "-//getahead limited//dtd Direct Web Remoting 2.0//en"
"Http://getahead.org/dwr/dwr20.dtd" >
Usermanager.java
Package com.struts;
public class Usermanager {
public boolean CCC (String uname)
My environment is Win2003+jdk+tomcat, the version is as follows
Jdk:jdk-6u10-rc2-bin-b32-windows-i586-p-12_sep_2008.exe
Tomcat:apache-tomcat-6.0.35.exe
I only need these 2 software can, do not have to create environment variables or anything, I have
The detailed introduction of JSP automatic compiling mechanism
In general, the Jasper Automatic detection mechanism is relatively simple, relying on a background thread to constantly detect the JSP file and the compiled class file after the final
Recently done projects, complete the task assigned by the project manager, started the Java Web, but encountered many problems in the development process, but I have the most headaches or import external CSS has been ineffective, plagued for a long
Implement the pyramid as shown in the JSP,
The code is as follows:
The general idea is as follows:
1, first draw the first 5 lines. Because the number of i+ spaces = Total number of rows, the number of spaces in the first line is the total
JSP Tags:
Implementation Request Forwarding to add parameters to the above
El expression:
1. Get Variable data
Hello, ${name}
2. Get Array data
Hello, ${names[0]}
3. Get Collection data
names=new
In the initial stage of learning Javaweb, you will encounter the Doget and Dopost methods in HttpServlet. The first two days saw the difference between get and post requests in the servlet, which is summarized as follows: Servlets & JSP.
1: The
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.