关于struts跳转问题 球高手
login.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>login </title>
</head>
<body>
<form action="${pageContext.request.contextPath}/struts/day1/login.do" method="post">
studentName <input name="studentname" type="text"">
password <input name="password" type="password">
<input type="submit" value="login">
</form>
</body>
</html>
struts配置中
<action path="/struts/day1/login" type="com.anbow.struts.day1.action.LoginAction">
<forward name="success" path="/day1/welcome.jsp"></forward>
<forward name="error" path="/day1/error.jsp"></forward>
</action>
action中
public class LoginAction extends Action {
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ActionForward forward=null;
String name=request.getParameter("studentname");
String passwd=request.getParameter("password");
StudentBizImp imp=new StudentBizImp();
Student student=null;
student=imp.login(name, passwd);
if(student!=null){
forward=mapping.findForward("success");
request.setAttribute("student", student);
}else{
forward=mapping.findForward("error");
request.setAttribute("message", "this user is not exit");
}
return forward;
}
}
从 login跳转时出现 这个错误。
404 错误
。。。。。。/$%7BpageContext.request.contextPath%7D/struts/day2/login.do这个是哪里错了?