My first JSP (Hello World) Program

Source: Internet
Author: User

Address: http://www.cnblogs.com/cjsh/articles/36271.html

I have been learning JSP for a long time, and I will never configure it. Today, the configuration is successful, so I will write this articleArticle,
Hope to help beginners. If you have any mistakes, I hope you can correct them.

1. Beginners: JSP environment Configuration
Refer to this article: http://www.cnjsp.org/view.jsp? Column = 2 & id = 747

After the installation is complete, you can also start the graphic configuration interface, as shown in:

2. helloworld. JSP Source Code :


JSP test page --- helloworld!


<%
out. println ("

Hello world!
Hello, world!

");
%>


3. Web. xml configuration file content:
xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi: schemalocation = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
Version = "2.4">

<Description>
JSPs 2.0 examples.
</Description>
<Display-Name> JSP 2.0 examples </display-Name>
</Web-app>
4. Set helloworld. put the JSP file .. \ Tomcat 5.0 \ webapps \ directory under the examples sub-directory (you can also put it in another directory), put the web. the XML file is placed in the WEB-INF subdirectory under the same directory.

5. Stop and restart tomcat, as shown in:

6. After the program configuration is completed, the result is shown as follows:

Copyright 2004 cjsh All Rights Reserved. Welcome to reprint, please indicate the source: http://www.cnblogs.com/cjsh

Category: Original Articles

End

I have been learning JSP for a long time and will never configure it. Today, the configuration is successful, so I wrote this article,
Hope to help beginners. If you have any mistakes, I hope you can correct them.

1. Beginners: JSP environment Configuration
Refer to this article: http://www.cnjsp.org/view.jsp? Column = 2 & id = 747

After the installation is complete, you can also start the graphic configuration interface, as shown in:

2. helloworld. JSP source Code :


JSP test page --- helloworld!


<%
out. println ("

Hello world!
Hello, world!

");
%>


3. Web. xml configuration file content:
xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi: schemalocation = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
Version = "2.4">

<Description>
JSPs 2.0 examples.
</Description>
<Display-Name> JSP 2.0 examples </display-Name>
</Web-app>
4. Set helloworld. put the JSP file .. \ Tomcat 5.0 \ webapps \ directory under the examples sub-directory (you can also put it in another directory), put the web. the XML file is placed in the WEB-INF subdirectory under the same directory.

5. Stop and restart tomcat, as shown in:

6. After the program configuration is completed, the result is shown as follows:

Copyright 2004 cjsh All Rights Reserved. Welcome to reprint, please indicate the source: http://www.cnblogs.com/cjsh

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.