我在tomcat的webapps下建了个文件夹helloapp 在helloapp中建了WEB-INF文件夹
又建了个index.jsp的文件 代码如下:
<html>
<body>
<%out.println( "hello java ");%>
</body>
<html>
然后在server.xml中的 <host> </host> 插如了 <Context path= "helloapp " docBase= "\helloapp " debug= "0 " reloadable= "true "/> 为什么老 是出错
请高手指点以下,或给个教程或给个例子小弟感激不尽
------解决方案--------------------------------------------------------
将项目放在%TOMCAT_HOME%\webapps目录下:
helloapp的目录结构
helloapp
|
|----WEB-INF
| |
| |--web.xml
|-index.jsp
web.xml文件内容:
--------------------------
<?xml version= "1.0 " encoding= "UTF-8 "?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN " "http://java.sun.com/dtd/web-app_2_3.dtd ">
<web-app>
<welcome-file-list>
<welcome-file> index.jsp </welcome-file>
</welcome-file-list>
</web-app>
----index.jsp文件----
<%@ page contentType= "text/html;charset=gb2312 "%>
<%@ page import= "java.sql.* "%>
<html>
<body>
<%out.println( "hello java ");%>
</body>
<html>
-------%TOMCAT_HOME%\conf\server.conf文件----
在 <host> </host> 间加入内容
<host>
Context path= "helloapp " docBase= "\helloapp " debug= "0 " reloadable= "true "/>
</host>
测试:http;//loacalhost;8080/helloapp/
测试成功