JSP development tutorial
1. Download and install JDK (assuming version 1.6 is installed under C: \ Program Files by default );
2. JDK environment variable settings
Right-click "my computer"-> properties-> advanced-> environment variable system variable-> Create java_home, variable value: "C: \ Program Files \ Java \ jdk1.6.0 _ 01 "; open the path, add"; "to the original value, and add" % java_home % \ bin; % java_home % \ jre \ bin "create classpath, variable value :".; % java_home % \ lib; % java_home % \ lib \ tools. jar "Remember the previous". ") Save, select" run "in the start, and press cmd to enter the simulated dos mode and check" java-version;
3. Download and install Tomcat 6.0;
4. Set Tomcat Environment Variables
Create an environment variable tomcat_home. The variable value is the directory where you install Tomcat,
For example, "G: \ Tomcat 6.0"; Add ";" to the classpath value and add "% tomcat_home % \ lib \ servlet-api.jar ;.";
5. Download and install Dreamweaver;
6. Configure Dreamweaver
Create a new directory named MyProject under webapps under the Tomcat installation directory as the root directory of the site;
JSP development Tutorial: 1) Create an empty JSP file
Open Dreamweaver and choose new> General> dynamic page> JSP;
JSP development Tutorial: 2) configure the Tomcat site
Choose site> create site from the menu;
Enter the name you like in the site name field. The site URL may not be used (you may not understand it later), but you can enter a URL at will for the moment. Next, click here to use server technology, select JSP in the drop-down box and click Next. select edit and test locally. Select the created MyProject as the storage location of the file and click Next. Enter "http: // localhost: 8080/MyProject/, click test URL, and the URL prefix test is successful. This indicates that the configuration has been successful. click Next; click Finish;
3) edit and test JSP
Copy the following code to the created JSP editing page.
- <% @ PageContentType="Text/html; charset = Gb2312"
- Language="Java" Import="Java. util .*"%>
- <Html>
- <Head><Title>JSP Example</Title></Head>
- <Body>
- The current time is:<% = New Date () %><Br>
- The current host is:<% = Request. getRemoteHost () %>
- </Body>
- </Html>
Start Tomcat;
Click the Earth-like button in the top toolbar and select preview in Iexplore 6.0. Save the first run and then you can see the running result. This JSP development tutorial ends here.
- Application Development in e-commerce website development
- Three considerations for choosing a JSP website Space
- JSP dynamic website development technology Overview
- How Tomcat improves performance on JSP pages
- Use of scripts Based on JSP tutorials