我再把相关配置信息贴出来,struts-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by zxczf (zxczf) -->
<!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="loginForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="id" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
</form-bean>
</form-beans>
<action-mappings>
<action path="/loginAction" type="com.gever.db.LoginAction" name="loginForm" scope="request" input="/login.jsp" validate="true">
<forward name="success" path="/viewVote.jsp" />
<forward name="failure" path="/error.jsp" />
</action>
</action-mappings> <message-resources parameter="com.gever.test.cookie.ApplicationResources" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in></struts-config>
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by zxczf (zxczf) -->
<!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="loginForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="id" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
</form-bean>
</form-beans>
<action-mappings>
<action path="/loginAction" type="com.gever.db.LoginAction" name="loginForm" scope="request" input="/login.jsp" validate="true">
<forward name="success" path="/viewVote.jsp" />
<forward name="failure" path="/error.jsp" />
</action>
</action-mappings> <message-resources parameter="com.gever.test.cookie.ApplicationResources" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in></struts-config>
解决方案 »
- 求助毕业设计
- 更改Myeclipse web项目tomcat的发布路径
- 关于juddi的问题,需要您的帮助,我将万分感谢!!!!
- spring+ibatis+自定义标签 问题
- 100分求jdom问题.解决马上送分.
- getOutputStream() has already been called for this response
- 能知道你用Hibernate是哪个版本吗?2.1.x or 3.x,最主要区别有什么呢?
- 关于struts的疑惑,期待你们的回复,万分感谢
- 在hibernate中,用Middlegen-Hibernate来实现对数据库中表的映射的问题???
- JMS可以实现双向的异步通讯吗?高分
- 急啊!help
- 给我学习EJB推荐一本书
<?xml version="1.0" encoding="ISO-8859-1" ?><!--
Validation Rules for the Struts Example Web Application $Id: validation.xml,v 1.4 2002/07/21 18:42:43 jholmes Exp $
--><form-validation>
<formset>
<form name="testForm">
<field property="name"
depends="required">
<arg0 key="testForm.prompt.name"/>
</field>
</form>
</formset>
</form-validation>调用的JSP页面:
<%@ page contentType="text/html;charset=GBK"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html>
<html:base />
<head>
<title>
</title>
</head>
<body>
<html:form action="loginAction" onsubmit="return validateLoginForm(this);">
<bean:message key="loginForm.title"/>
<br>
<table width="75%" border="0">
<tr>
<td colspan="6"><FONT SIZE="5" COLOR="red"> 自动生成EXCEL报表功能</FONT></td>
</tr>
<tr>
<td>请输入用户ID: <html:text property="id" /></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>请输入用户密码: <html:password property="password" /></td>
</tr>
<tr>
<td><html:submit value="提交" onclick="bCancel=false;" /> <html:reset value="重置"/></td>
</tr>
</table>
</html:form>
<%--
Referencing the registrationForm since they are identical
so I don't need a separate validation.xml listing just for this form.d
--%>
<html:javascript formName="loginForm"/></body>
</html:html>