跪求struts的框架客户端验证?-------在线等 不明白楼主说什么,是要标签的方式实现呢,还是要JavaScript方式实现?p.s.:程序员的表达能力为什么都这么差? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我是个struts的初学者,我想问一下,如果用纯html写的Jsp代码可以用struts的框架的标记实现javascript的自动验证吗?还是必须自己写javascript来实现啊 还是不太明白你的意思,下面不知道是不是你想要的,可以在action中进行数据校验,然后将校验或者异常结果写入到Errors中ActionErrors errors = new ActionErrors();errors.add("system_error", new ActionMessage("error.sys_error"));request.setAttribute(Globals.ERROR_KEY, errors); //其中error.sys_error是通过properties文件读取的jsp通过<html:errors bundle="err" property="system_error"/>就可以显示上面的异常信息啦 我想把那个错误信息显示在javascript的提示框里,并且实现了框架的客户端自动验证如果我用struts的标记库写这个login.jsp<%@ page language="java" pageEncoding="GBK"%><%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %><%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %><%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %><%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html:html lang="true"> <head> <html:base /> <title>login.jsp</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <html:form action="login.do" method="post" focus="name" onsubmit="return validateLoginForm(this)"> <table border="0"> <tr> <td>name:</td> <td><html:text property="name" /> <html:errors property="name"/></td> </tr> <tr> <td>Password:</td> <td><html:password property="password" /></td> </tr> <tr> <td colspan="2" align="center"><html:submit /></td> </tr> </table> </html:form> <html:javascript formName="loginForm"/> </body></html:html>就可以实现,可是如果我把这文件紧用纯html,比如<html:form>我写为html<form>此功能就不实现 我现在想问的是在传统的html标记中,可以运用struts框架的客户端自动验证吗?也就是说在传统的传统的html页面中可以运用struts框架自动生成javascript吗? oracle语句看不懂,求高手指导 大家帮我出出主意 简单spring配置request范围问题 请问服务器端怎么读取别人客户端上的文件 hibernate映射文件如何映射枚举类型? 急, struts项目 想配置index.do为首页面 怎么配置? 不能转发! 用java怎么实现登录到百度 局域网内类似QQ的聊天程序,求教如何实现 jboss中文显示全部是????的乱码,help! J2EE 菜鸟问题 (linux版的) web.xml 配置 各位帮忙啊,我怎么设计表结构才能在MYECLIPSE中自动 生成一对一的HBM呀
errors.add("system_error", new ActionMessage("error.sys_error"));
request.setAttribute(Globals.ERROR_KEY, errors); //其中error.sys_error是通过properties文件读取的jsp通过
<html:errors bundle="err" property="system_error"/>就可以显示上面的异常信息啦
如果我用struts的标记库写这个login.jsp
<%@ page language="java" pageEncoding="GBK"%><%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />
<title>login.jsp</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<html:form action="login.do" method="post" focus="name" onsubmit="return validateLoginForm(this)">
<table border="0">
<tr>
<td>name:</td>
<td><html:text property="name" /> <html:errors property="name"/></td>
</tr>
<tr>
<td>Password:</td>
<td><html:password property="password" /></td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit /></td>
</tr>
</table>
</html:form>
<html:javascript formName="loginForm"/>
</body>
</html:html>
就可以实现,可是如果我把这文件紧用纯html,比如<html:form>我写为html<form>此功能就不实现
也就是说在传统的传统的html页面中可以运用struts框架自动生成javascript吗?