2012-12-03 70 views
0

我真的是新的网络应用程序,这是我第一次使用tomcat。尝试运行index.jsp时,我不断收到此消息。http 404错误报告tomcat eclipse

screenshot

我使用的Eclipse靛蓝,在Tomcat 6.0(在本地主机的Tomcat V6.0服务器已经启动和同步)。我已经将ROOT文件夹复制到wtpwebapp,在server.xml文件中选中<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />,但没有任何效果。

这里的服务器配置: enter image description here

我刚开始的index.jsp这个:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
pageEncoding="ISO-8859-1"%> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"         "http://www.w3.org/TR/html4/loose.dtd"> 
    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
    <title>Insert title here</title> 
    </head> 
    <body> 
    Hello World! 
    </body> 
    </html> 

,这是我的web.xml

  <?xml version="1.0" encoding="UTF-8"?> 
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> 
     <display-name>ChatBot</display-name> 
     <welcome-file-list> 
     <welcome-file>index.html</welcome-file> 
     <welcome-file>index.htm</welcome-file> 
     <welcome-file>index.jsp</welcome-file> 
     <welcome-file>default.html</welcome-file> 
     <welcome-file>default.htm</welcome-file> 
     <welcome-file>default.jsp</welcome-file> 
     </welcome-file-list> 
    </web-app> 

我不知道什么是错的。 ..提前致谢。

+0

您使用的是什么链接?我的意思是项目名称 –

+0

@sheldonCooper名称的ChatBot和链接的http:// localhost:8080/ChatBot/index.jsp – bronze45

回答

2

首先,我想知道使用哪个帧工作。如果妳R ON支柱工作2只是尝试使用此代码替换在web.xml中我们的代码...

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> 

<display-name>Struts2</display-name> 

<filter> 
    <filter-name>struts2</filter-name> 
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> 
</filter> 

<filter-mapping> 
    <filter-name>struts2</filter-name> 
    <url-pattern>*.action</url-pattern> 
</filter-mapping> 

<filter-mapping> 
    <filter-name>struts2</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

    <welcome-file-list> 
    <welcome-file>index.jsp</welcome-file> 
    </welcome-file-list> 

</web-app> 
+0

+1以获得准确答案 – Athul

0

以下为我工作:尝试拖动index.jspWebContent目录。然后,右键单击index.jsp并单击“在服务器上运行”。