【发布时间】:2018-09-17 18:43:47
【问题描述】:
这是我的配置:
Tomcat 6<br/>
jdk1.6<br/>
MyEclipse
Win 7
HTTP Status 404 -
type Status report
我在 MyEclipse 中设置了一个名为“ch21”的动态 Web 项目,其结构如下。 Web应用程序在本地运行良好。但是当我将其上传到网站时。然后我无法调用任何jsp文件。例如index.jsp,regist.jsp。 错误信息如下。
HTTP 状态 404
message
description The requested resource () is not available.
Apache Tomcat/6.0.29
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">
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
</web-app>
struts.xml
<constant name="struts.i18n.encoding" value="gb2312"></constant>
<package name="struts2" extends="struts-default">
<action name="regist" class="regAction">
<result name="success" >/login.jsp</result>
<result name="input">/regist.jsp</result>
<result name="error">/regist.jsp</result>
</action>
</package>
我在 web.xml 中添加了以下内容。
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>register.jsp</welcome-file>
</welcome-file-list>
我打电话给http://example.net/index.jsp。但它不起作用。 错误信息:HTTP 状态 404。
【问题讨论】:
-
没有。就是不行。 Read this 再试一次。
-
当我关闭项目时,eclipse 给出一个错误:“磁盘空间不足”,我不得不关闭 myeclipse。然后,我无法打开myeclipse。我建立了一个新文件夹并重建了项目,但是它给出了上述错误..非常感谢您
-
我可以删除我的问题并重新开始
-
@L Linda 可能,如果你没有被禁止提问的话。只需确保在您的第一次尝试中包含所有相关信息,通常在前几分钟决定您是否要获得帮助。请务必阅读How to ask 中的所有内容,包括右侧黄色框中的子文章。确保您对问题进行校对,或者如果您的英语不够好,请让别人为您校对。为minimal reproducible example 包含足够的代码,说明一个明确的问题,您尝试解决的问题等。