JSP development Tutorial: comprehensive use of JDK + Tomcat + Dreamweaver

Source: Internet
Author: User

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.

 
 
  1. <% @ PageContentType="Text/html; charset = Gb2312"
  2. Language="Java" Import="Java. util .*"%> 
  3. <Html> 
  4. <Head><Title>JSP Example</Title></Head> 
  5. <Body> 
  6. The current time is:<% = New Date () %><Br> 
  7. The current host is:<% = Request. getRemoteHost () %> 
  8. </Body> 
  9. </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.

  1. Application Development in e-commerce website development
  2. Three considerations for choosing a JSP website Space
  3. JSP dynamic website development technology Overview
  4. How Tomcat improves performance on JSP pages
  5. Use of scripts Based on JSP tutorials

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.