单看web.xml没有问题啊
检查一下其他的看看。
检查一下其他的看看。
解决方案 »
- hibernate和json出错的问题
- 求高手!!! java 局域网聊天器 代码 求高手改!!!
- Hibernate如何映射一个没有ID的JavaBean??
- AXIS2集成Spring后的Session管理
- 为什么人家运行正确我却不正确呢?关于枚举定义
- 要命的问题:用JBossIDE for Eclipse 新建EJB3.0工程时就带上红叉
- 菜鸟求解答!JSP中跳转问题
- struts框架下的类继承问题?在线等。。请大家帮忙看看
- http://struts-menu.sf.net/ 的菜单问题(在线等)
- 请问那里有sql server jdbc driver?
- spring的例子jpetstore,是怎样创建购物车的?请高手解答!200分相送
- 怎样使用泛型实现Hibernate查询返回对象?
<data-sources />
<form-beans >
<form-bean name="userLoginForm" type="com.yourcompany.struts.form.UserLoginForm" /> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="userLoginForm"
input="/userLogin.jsp"
name="userLoginForm"
path="/userLogin"
scope="request"
type="com.yourcompany.struts.action.UserLoginAction">
<forward name="success" path="/userLoginSuccess.jsp" />
<forward name="failure" path="/userLogin.jsp" />
</action> </action-mappings> <message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>jsp界面<%@ page language="java"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%><html>
<head>
<title>JSP for userLoginForm form</title>
</head>
<body>
<html:form action="/userLogin">
password : <html:password property="password"/><html:errors property="password"/><br/>
userName : <html:text property="userName"/><html:errors property="userName"/><br/>
<html:submit/><html:cancel/>
</html:form>
</body>
</html>这是actionpublic ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
UserLoginForm userLoginForm = (UserLoginForm) form; if(userLoginForm.getUserName().equals("myeclipse") && userLoginForm.getPassword().equals("myeclipse"))
{
request.setAttribute("userName", userLoginForm.getUserName());
return mapping.findForward("success");
} return mapping.findForward("failure");
}
}