初学者再问Tomcat问题,简单得不能再简单,就是搞不定
拜托各位耐心教教我,这个问题今晚一定要搞定!!!
我在/webapps下建立了new文件,new下建立了WEB-INF和index.jsp,WEB-INF下建立了web.xml和classes和lib(classes和lib都是空的)。
index.jsp中内容如下:
<%@ page language= "java " %>
<html>
<head>
<title> Hello World! </title>
</head>
<body bgcolor= "#FFFFFF " text= "#000000 ">
<% out.println( "Hello World! "); %>
</body>
</html>
web.xml中内容如下:
<?xml version= "1.0 " encoding= "ISO-8859-1 "?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License ");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS " BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns= "http://java.sun.com/xml/ns/j2ee "
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 ">
<display-name> Welcome to Tomcat </display-name>
<description>
Welcome to Tomcat
</description>
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name> org.apache.jsp.index_jsp </servlet-name>
<servlet-class> org.apache.jsp.index_jsp </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> org.apache.jsp.index_jsp </servlet-name>
<url-pattern> /index.jsp </url-pattern>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app> <