Eclipse3.0+Tomcat4.1+Struts1.1非常简单的问题,对环境文件熟的人请进

sharpfire 2005-04-26 07:09:34
这是我的第一个JSP,现在只能看见一页。跳页还不成功,基于本人能力有限环境文件我实在是找不出错误拉。请高手指教。以下是我代码和各文件的路径。

web.xml
//////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<!-- Standard Action Servlet Configuration -->
<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/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
//////////////////////////////////////////////////////////////
struts-config.xml
///////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<form-beans>
<form-bean name="LGINForm"
type="login.LGINForm"/>
</form-beans>
<global-forwards>
<forward name="overview" path="/failed.jsp"/>
</global-forwards>
<action-mappings>
<action path="/regist"
type="login.LGINAction"
name="LGINForm"
scope="request"
input="/index.jsp">
<forward name="success" path="/regist.jsp"/>
</action>
</action-mappings>
</struts-config>
//////////////////////////////////////////////////////////////////////////////
index.jsp
///////////////////////////////////////////////////////////////////////////////////
<%@ page contentType="text/html;charset=GBK" language="java" %>
<html>
<head>
<title>用户登录页面</title>
<script language="JavaScript">
<!--
function onSubmit(){
document.forms[0].action = "regist.do";
document.forms[0].target = "_self";
document.forms[0].submit();
alert();
}
-->
</script>
</head>
<body background="./images/bg.gif">
<a href="overview.do">站点导航</a><br>
<form method="post">
<table align="center">
<tr>
<td>
用户:<input type="text" name="name">
</td>
</tr>
<tr>
<td>
密码:<input type="password" name="ps">
</td>
</tr>
</table>
<button class="button" type="button" name="btnRegist" onClick="onSubmit();"><img src="./images/button/regist.gif">登录</button>
</form>
</body>
</html>
////////////////////////////////////////////////////////////////////////////////
以下是个文件的路径
/////////////////////////////////////////////////////////////////////////////////
G:\testproject\arc\login 下有 LGINAction.java LGINForm.java

G:\testproject\testproject_web\WEB-INF 下有 web.xml struts-config.xml index.jsp regist.jsp failed.jsp

C:\Program Files\Apache Group\Tomcat 4.1\conf 下 server.xml里
<!-- Tomcat Root Context -->
<Context path="/testproject" docBase="G:\testproject\testproject_web\WEB-INF" debug="0"/>
////////////////////////////////////////////////////////////////////////////////
以下是错误信息
////////////////////////////////////////////////////////////////////////////////
HTTP Status 404 - /testproject/regist.do

type Status report
message /testproject/regist.do
description The requested resource (/testproject/regist.do) is not available.

Apache Tomcat/4.1.31
...全文
352 19 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
sharpfire 2005-05-12
  • 打赏
  • 举报
回复
谢谢大家,问题解决啦
salina说的对,是我的tomcat设置问题,特别谢谢你
现在开始揭帖
sharpfire 2005-05-12
  • 打赏
  • 举报
回复
还有人知道吗?
sharpfire 2005-05-10
  • 打赏
  • 举报
回复
谢谢,我也认为是路径的问题
可是我要改为docBase="G:\testproject\testproject_web" 后tomcat不能启动,不知道为什么。
michaelyf 2005-05-10
  • 打赏
  • 举报
回复
就是你的文件放置存在问题
michaelyf 2005-05-10
  • 打赏
  • 举报
回复
<!-- Tomcat Root Context -->
<Context path="/testproject" docBase="G:\testproject\testproject_web\WEB-INF" debug="0"/>
感觉你的docBase不正确,是否应该为docBase="G:\testproject\testproject_web" debug="0"/>
sharpfire 2005-05-10
  • 打赏
  • 举报
回复
哥哥们,我想知道的是我写得有没有错,或是还差什么没写
有没有人知道呀
zhkchi 2005-05-09
  • 打赏
  • 举报
回复
概念:struts是管理web 层开发的,需要web.xml以及struts-config.xml来部署描述。

sharpfire 2005-05-09
  • 打赏
  • 举报
回复
请问各位大哥,在eclipse里用struts是不是只要配置web.xml和struts-config.xml就可以拉。本人是这么理解的。还有其他的文件需要配置吗?或是其他的环境需要配置
sharpfire 2005-05-06
  • 打赏
  • 举报
回复
我没有用easystruts插件,也没有用myeclipse
本人就用的是一般的eclipse和struts1.1。我们公司用的也是这个,可以用是肯定没有问题的
ayace 2005-05-03
  • 打赏
  • 举报
回复
可以用myeclipse
不过收费。。。
japhone 2005-05-02
  • 打赏
  • 举报
回复
说错了,是easystruts插件不支持eclipse3
sharpfire 2005-05-02
  • 打赏
  • 举报
回复
支持是肯定没问题的
japhone 2005-05-02
  • 打赏
  • 举报
回复
struts1.1支持eclipse3.0吗?
我正也在搞这东东
听说eclipse3没有struts的插件,要自己写struts-config.xml
sharpfire 2005-05-02
  • 打赏
  • 举报
回复
To:querlang
刚才看了一下公司其他工程的struts-config.xml都和我原来那个写的一样呀。
你那样写对吗?假如我有两对<action></action>你那样写,系统知道去那吗?
sharpfire 2005-05-02
  • 打赏
  • 举报
回复
谢谢各位仁兄
尤其是querlang

querlang 2005-04-28
  • 打赏
  • 举报
回复
<struts-config>
<form-beans>
<form-bean name="LGINForm"
type="login.LGINForm"/>
</form-beans>
<global-forwards>
<forward name="overview" path="/failed.jsp"/>
</global-forwards>
<action-mappings>
<action path="/regist"
type="login.LGINAction"
name="LGINForm"
scope="request"
input="/index.jsp">
<forward name="success" path="/regist.jsp"/>
</action>//注意这里
</action-mappings>
</struts-config>
这一段错了,应该是
<struts-config>
<form-beans>
<form-bean name="LGINForm"
type="login.LGINForm"/>
</form-beans>
<global-forwards>
<forward name="overview" path="/failed.jsp"/>
</global-forwards>
<action-mappings>
<action path="/regist"
type="login.LGINAction"
name="LGINForm"
scope="request"
input="/index.jsp">

</action>
<forward name="success" path="/regist.jsp"/> //注意这里
</action-mappings>
</struts-config>
dingzhiping2003 2005-04-28
  • 打赏
  • 举报
回复
这位仁兄,你的Eclipse3.0+Tomcat4.1+Struts1.1这个环境是怎么配的,是不是加了org.easystruts.eclipse_0.6.4就可以了,当然tomcatPluginV3我已经加了?但是好像我加了org.easystruts.eclipse_0.6.4后,在preference中没看到easystruts选项嘛
sharpfire 2005-04-28
  • 打赏
  • 举报
回复
自己顶,各位大哥帮帮忙呀。这个问题郁闷我好久拉。
sharpfire 2005-04-27
  • 打赏
  • 举报
回复
各位大哥,这么简单的问题不会没人回吧

58,452

社区成员

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

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