http status 404 错误,急救!!!help

fwinsky 2010-12-11 01:04:07
输入 http://localhost:8888/GP 可以看到文件列表,点webroot进入后可以打开index.jsp页面,但是如果直接输入http://localhost:8888/GP/Login1001_Init.do,则会报404错误,如下:
HTTP Status 404 - /GP/Login1001_Init.do
type Status report
message /GP/Login1001_Init.do
description The requested resource (/GP/Login1001_Init.do) is not available.
Apache Tomcat/6.0.18


配置文件如下:
web.xml:
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
WEB-INF/config/login-struts-config.xml
</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


login-struts-config.xml:
<form-beans>
<form-bean name="Login1001Form" type="com.granduateproject.login.form.Login1001Form" />
</form-beans>
<action-mappings>
<action path="/Login1001_Init"
type="com.granduateproject.login.action.Login1001Action"
parameter="Init"
name="Login1001Form"
scope="request">
<forward name="Default" path="/jsp/login/login.jsp" />
</action>
</action-mappings>
</struts-config>


tomcat使用的是自动部署
...全文
182 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
浪漫江湖 2010-12-11
  • 打赏
  • 举报
回复
自己解决了什么?
fwinsky 2010-12-11
  • 打赏
  • 举报
回复
自己解决了……
qq363207624 2010-12-11
  • 打赏
  • 举报
回复
如果用的tomcat5.0,我建议用换成6.0

5.0瞎报错.莫明其妙就喜欢报404.

用6.0,如果有问题的话.一启动就报很明显的错.

那样就比较好找了!
丰太君 2010-12-11
  • 打赏
  • 举报
回复
命名时不要下划线。试试。
fwinsky 2010-12-11
  • 打赏
  • 举报
回复
求解。。。
fwinsky 2010-12-11
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 xiluhua 的回复:]

把你的--"WEB-INF/config/下的 "login-struts-config.xml"
名字改回来,改成struts.xml,这是系统识别的文件名,不能任意改动的.否则他就读不到了,试试.
另外,输入http://localhost:8888/GP/Login1001_Init,后面的.do不要输
[/Quote]
我去掉了,可是还是一样的错误:
HTTP Status 404 - /GP/Login1001_Init
gouxiongyaya 2010-12-11
  • 打赏
  • 举报
回复
<url-pattern>/*.do</url-pattern>
city223 2010-12-11
  • 打赏
  • 举报
回复
输入http://localhost:8888/GP/Login1001_Init,后面的.do不要输
xiluhua 2010-12-11
  • 打赏
  • 举报
回复
把你的--"WEB-INF/config/下的 "login-struts-config.xml"
名字改回来,改成struts.xml,这是系统识别的文件名,不能任意改动的.否则他就读不到了,试试.
另外,输入http://localhost:8888/GP/Login1001_Init,后面的.do不要输
fwinsky 2010-12-11
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 yaganblw 的回复:]

仔细检查
[/Quote]

我眼都要看花了
yaganblw 2010-12-11
  • 打赏
  • 举报
回复
仔细检查

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧