• 全部
  • Java SE
  • Java EE
  • J2ME
  • IDE工具
  • 求助
  • 内推招聘
  • 问答

关于Validation的错误,请大家帮忙看看

jackedfang 2004-03-19 05:37:45
jsp页面如下:
<%@ taglib uri="struts/bean-el" prefix="bean" %>
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@ taglib uri="struts/logic-el" prefix="logic" %>
<%@ taglib uri="jstl/c" prefix="c" %>
<html>
<head>
<link href="<html:rewrite page="/rr.css" />" rel="stylesheet" type="text/css">
<center><title><bean:message key="title.devicestatus.deviceStatusForm"/></title></center>
</head>
<body><center>
<c:choose>
<c:when test="${DeviceActionForm.map.dispatch == 'insert'}">
<h1><bean:message key="title.devicestatus.insertDeviceStatusForm"/></h1>
</c:when>
<c:otherwise>
<h1><bean:message key="title.devicestatus.updateDeviceStatusForm"/></h1>
</c:otherwise>
</c:choose>
<!-- this should be an include or, better yet, use tiles and make this a footer !-->
<logic:messagesPresent>
<span id="errorsHeader"><bean:message key="errors.validation.header"/></span>
<html:messages id="error">
<li><c:out value="${error}"/></li>
</html:messages>
<hr>
</logic:messagesPresent>

<logic:messagesPresent message="true">
<html:messages id="message" message="true">
<span id="success"><c:out value="${message}"/></span><br>
</html:messages>
</logic:messagesPresent>

<html:form action="deviceStatusAction" focus="status">
<table>
<tr>
<td ><bean:message key="display.devicestatus.status"/></td>
<td><c:choose>
<c:when test="${DeviceStatusForm.map.dispatch == 'insert'}">
<html:text property="status"/>
</c:when>
<c:otherwise>

<html:text property="status"/>
</c:otherwise>
</c:choose>
</td>
</tr>

<tr>
<td ><bean:message key="display.devicestatus.statusName"/></td>
<td><html:text property="statusName"/></td>
</tr>
<tr>
<td ><bean:message key="display.devicestatus.deviceTypeId"/></td>
<!--td><html:text property="deviceTypeId"/></td-->
<td><html:select name="DeviceStatusForm" property="deviceTypeId">
<html:options collection="deviceInfoDict" property="id" labelProperty="name"/>
</html:select>
</td>
</tr>

</table>
<html:hidden name="DeviceStatusForm" property="dispatch"/>
<html:hidden property="recId"/>

<c:choose>
<c:when test="${DeviceStatusForm.map.dispatch == 'insert'}">
<html:submit><bean:message key="button.submit"/></html:submit>
</c:when>
<c:otherwise>
<html:submit><bean:message key="button.update"/></html:submit>
</c:otherwise>
</c:choose>

</html:form>
</center></body>
</html>
我要对status加一个验证,validation.xml文件如下:
<form name="DeviceStatusForm">
<field property="status"
depends="required,maxlength">
<arg0 key="display.deviceaction.deviceTypeId"/>
<arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
<var>
<var-name>maxlength</var-name>
<var-value>4</var-value>
</var>
</field>
</form>
struts-config.xml文件如下:
<action path="/deviceStatusAction"
type="sc.snow.devicestatus.DeviceStatusAction"
name="DeviceStatusForm"
scope="request"
validate="true"
parameter="dispatch"
input="/pages/devicestatus/deviceStatusForm.jsp"
>
<forward
name="continue"
path="/pages/devicestatus/deviceStatusResult.jsp"/>
</action>
错误信息是:
javax.servlet.ServletException: Cannot find bean under name deviceInfoDict
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.pages.devicestatus.deviceStatusForm_jsp._jspService(deviceStatusForm_jsp.java:132)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
...全文
33 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
hajavaor 2004-03-24
就给10分,太小气了吧。
干脆再公开你的电话吧,呵呵。

阿勇
回复
hiking 2004-03-22
你对这相关的关联性到底了不了解?
回复
yeshucheng 2004-03-22
去看看你的web.xml中的配置
回复
jackedfang 2004-03-22
没人帮忙看啊?我自己顶啦。
回复
发帖
Java
创建于2007-09-28

4.7w+

社区成员

Java相关技术讨论
申请成为版主
帖子事件
创建了帖子
2004-03-19 05:37
社区公告
暂无公告