运行J2EE项目报HTTP Status 404错误,急!!

xie814822068 2010-11-21 11:28:24
本人正在学习J2EE,前几天编写了一个登录界面,但是一运行就报404,各个文件的路径都是正确的
第一步进入登录页面没有问题,输入用户名和密码后提交,进入ActionLogin_1.java进行处理,但是到这里就报404了:
HTTP Status 404 - /J2EE_firstexercise/ActionLogin_1

--------------------------------------------------------------------------------

type Status report

message /J2EE_firstexercise/ActionLogin_1

description The requested resource (/J2EE_firstexercise/ActionLogin_1) is not available.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.10

另外我的struts.xml内部的文件路径也是写对了的:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="default" extends="struts-default">
<action name="actionlogin_1" class="textlogin.ActionLogin_1">
<result name="success">/success.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>
</struts>

但是就是无法跳转页面!
顺便说下ActionLogin_1.java的源代码,我编写了个Dao类来进行对数据库的操作,代码都是没有问题的:
package textlogin;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ActionLogin_1 extends ActionSupport implements ModelDriven<User>
{
private User user=new User();

public User getModel() {
return user;
}

@Override
public String execute() throws Exception
{
Dao userdao=new Dao();
boolean flag = userdao.validateLogin(user.getUsername(), user.getPassword());
if(flag)
{
return SUCCESS;
}
else
{
return ERROR;
}
}
}
...全文
187 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
不善^ 2010-11-21
  • 打赏
  • 举报
回复
404 是路径的问题 再检查下

67,550

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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