Win7 Tomcat 7.0 release JSP web (MYSQL) project detailed steps

Source: Internet
Author: User
Tags tomcat server

1, first install a suitable for the JSP operating environment.

Jdk+tomcat.

1) First install the Java Runtime environment. (Recommended default path installation)

Link: Http://pan.baidu.com/s/1ntiU6NJ Password: hs57

2) Install JDK (recommended default path installation)

Link: Http://pan.baidu.com/s/1c0nqCRA Password: 4XDW

3) Install Tomcat

Link: http://pan.baidu.com/s/1eQ8RpOe Password: 432d

4) Configure Environment variables

A. " Computer Right-click Properties--Advanced system settings--advanced--environment variables opens the Environment variable Settings window.
B. In the "System Environment variables" Setting window below, click "New" to createJava_homevariables:    
Variable Name:Java_home    
variable Value: C:\Program files\java\jdk1.6.0
c. In the "System Environment variables" Setting window below, click "New" to createCLASSPATHvariables:    
Variable Name:CLASSPATH   
variable Value: C:\Program files\java\jdk1.6.0\lib\dt.jar; C:\Program Files\java\jdk1.6.0\lib\tools.jar; (note semicolon)
D. In the System Environment Variables Settings window below, double-click thePATH"variable, added after the value of the variable:    ; C:\Program Files\java\jdk1.6.0_26\bin; (Note Semicolon)
Step three: Enter in "Run"cmd, enter the command window after entering theJavac, if it appears:

That means the installation configuration is correct.


If it appears:

This is because the system does not recognize the Javac command, either because you did not install the JDK correctly, or if the environment variable settings did not work.



Solution:
Run-->cmd
Run the following command in the console to set the Java environment variable to resolve:
Set Java_home=c:\program files\java\jdk1.6.0 Install the root directory of the JDK
Set Classpath=%java_home%\lib\tools.jar;%java_home%\lib\dt.jar;
Set Path=%java_home%\bin;

2. Test Tomcat

After successful completion of the above steps, enter: http://localhost:8080 or http://127.0.0.1:8080 on the browser side, if the Tomcat default home page is displayed successfully, the Tomcat server installation is configured correctly.

The port number can be modified in the following ways:

Reference: http://www.ltesting.net/ceshi/ruanjianceshikaifajishu/rjcskfyy/zjj/tomcat/2008/0602/154943.html

3. Store the project under the WebApps folder in the Tomcat installation directory.

In the browser-side input: http://server IP-port number/project name/project home page

4. Install Database Mysql+navicat

Link: Http://pan.baidu.com/s/1jGImCXC Password: 2y92

Link: Http://pan.baidu.com/s/1eQ6P8yQ Password: f7bu

MySQL combination navicat use more convenient Oh ~

After the installation is complete, go to navicat and create a new connection with the following steps:

Then create a new database and data table.

5. Connecting Database Code Snippets

<%

  

String driverclass= "Com.mysql.jdbc.Driver";
String url= "Jdbc:mysql://localhost:3308/test";
String username = "root"; When I installed MySQL, I started the
String password = "root"; When you install MySQL, you set your own custom settings.
Class.forName (Driverclass); Load Database Driver
Connection conn=drivermanager.getconnection (URL, username, password); Establish a connection
Statement stmt=conn.createstatement ();

OUT.PRITLN ("Connection Successful! ");

Conn.close ();

%>

6, to this end, the basic framework has come out, combined with your own Web page Production section, then the JSP site to complete the release of ~

Win7 Tomcat 7.0 release JSP web (MYSQL) project detailed steps

Related Article

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.