JSP summary of the six: Create the first simple JSP page __jsp

Source: Internet
Author: User
Tags apache tomcat netbeans
Create manually 1. Create a new directory under the WebApps directory of Tomcat 6.0 's installation directory, named MyApp. 2, in the MyApp directory to create a new directory Web-inf, note that the directory name is case-sensitive. 3, Web-inf under a new file Web.xml, the contents are as follows: <?xml version= "1.0" encoding= "gb2312"?> <web-app> <display-name>my     Web application</display-name> <description> an application for test. </description> </web-app> 4, create a new test JSP page under MyApp, the file name is index.jsp and the contents are as follows: Eclipse Creation 1. After installing JDK1.6.0 and TOMCAT6.0, copy the Eclipse software to a folder on your local hard drive. 2, install Eclipse plug-in myeclipse. 3, run Eclipse.exe file, open, select the path window->preferences, pop-up page as follows: 4, select Java->installed JREs, click the "Add" button, pop-up: 5, in the "JRE home Directory, select the installation path for JDK1.6.0 (such as "c:/jdk1.6.0_02") and fill in the name of the identity (such as "jdk1.6.0_02") in the JRE name bar. After filling, click "OK" to determine. 6, then select the path server-> installed runtimes, pop-up box as follows: 7, select Apache Tomcat v6.0, click "Next", pop-up: Select the Tomcat and JDK to use, and then click "Finish" close the window, Exit the Preferences window. 8. Select File->new->project in Eclipse and create a new project. Pop-up: 9, then select "Dynamic Web project", click "Next", in the prompt to fill in the project name (such as "test1") and so on, and finally click "Finish", the project new success. 10, in the new project, right click on the "WebContent" folder, select the new "JSP" file, named "index.jsp." "Index.jsp" <body></body> fill in "<center>now time is: <%=new java.util.Date ()%></center> ”。 11. Select "Servers" in the lower right column of Eclipse and click on the Green Run button with a white triangle in the middle. When "state" of "Servers" is displayed as "started", the operation succeeds. 12, in the browser's address bar input "http://localhost:8080/test1/index.jsp", you can see a display of Time JSP page. NetBeans Create        NetBeans6.0 Milestone10 is currently the best NetBeans series software. has a powerful visual development function, whether for Java Swing or JSP. Sun plans to officially release NetBeans 6 this November. NetBeans 7 is officially released next November. Because eclipse's visual development relies on a variety of plug-ins, the most powerful plug-in myeclipse is commercial software, MyEclipse and NetBeans are functionally equivalent. It is therefore recommended to use NETBEANS6 because it is open source, free of charge, is legitimate to use, and eliminates the option of installing various Eclipse plug-ins.        after the installation of NETBEANS6, the starting screen is as follows:                after startup, go to main screen:          Select File->new Project menu, Then select the category for project for the Web, select the Web application. The following image:        Click Next, the following screen appears:        Select the Add button in the server column, Then set the Tomcat installation directory in the following dialog box.        Press Next, the following screen appears:        do not select any framework, We just create the simplest JSP pages. When the project is created, the index.jsp file is displayed. The source code is as follows: <% @page contenttype= "text/html"%> <% @page pageencoding= "UTF-8"%> <%--the taglib directive Imports the JSTL library. If you are uncomment it, youmust also add the JSTL library to the project. The Add Library ... action on Libraries node in Projects View can is used to Add the JSTL 1.1 Library. --%> <%--<% @taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%>--%>   <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"    "Http://www.w3.org/TR/html4/loose.dtd" > & nbsp
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.