JSP learning notes (2) -- use tomcat to run JSP files

Source: Internet
Author: User

Some netizens do not know how to run their own JSP files. I will give you a brief introduction here and provide you with some reference:
1. Download and install Tomcat. : Http://jakarta.apache.org/tomcat
2. compile your own JSP webpage and Java object.
3. Configure your own web application. Configuration method:
Add a line to the tomcat_home/CONF/server. xml file:
<Content Path = "/appname" docbase = "webapps/appname" DEBUG = "0" reloadable = "true"/>
Tomcat_home is the main directory of Tomcat, and appname is the name of your web application.
4. Copy your JSP, HTML, and image files to the tomcat_home/webapps/appname directory.
5. compile your Java file.
6. Copy the compiled class file to the tomcat/webapps/WEB-INF/classes directory. You can also package the class file into a jar file to 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
Here, appname is the Web application name you configured, and youjsp. jsp is the JSP file name you wrote.

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.