Running a JSP file in Tomcat

Source: Internet
Author: User
Tags tomcat

Some netizens do not know how to run their own JSP files, I briefly introduce here, to provide you with a point of reference:

1. Download and install Tomcat. Download Address: Http://jakarta.apache.org/tomcat

2. Write your own JSP Web pages and Java objects.

3. Configure your own Web application. Configuration method:

In Tomcat_home/conf/server. Add a line to the XML file:

<content path= "/appname" docbase= "webapps/appname" debug= "0" reloadable= "true"/>

Where Tomcat_home is the home directory of TOMCAT, AppName is the name of your Web application.

4. Copy your jsp files, HTML files, image files to the Tomcat_home/webapps/appname directory.

5. Compile your Java files.

6. Copy the compiled class file to the Tomcat_home/webapps/web-inf/classes directory. You can also package the class file into a jar file and place it in the Tomcat_home/webapps/web-inf/lib directory.

7. All is ok! You can see your results in your browser:

Http://localhost:8080/appName/youJSP.JSP

Among them, appname is your Web application name, youjsp.jsp is the JSP file name you write.

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.