说具体点。
这里有篇文章可以供你参考。
http://tech.ccidnet.com/pub/article/c1077_a170353_p1.html
http://tech.ccidnet.com/pub/article/c322_a173747_p1.html
这里有篇文章可以供你参考。
http://tech.ccidnet.com/pub/article/c1077_a170353_p1.html
http://tech.ccidnet.com/pub/article/c322_a173747_p1.html
解决方案 »
- spring mvc 拦截器 拦截不到请求
- Hibern8IDE
- 请大哥帮帮忙啊!
- j2eesdk与j2sdkee有什么关系阿??
- 运行 RMI 程序 问题?
- 我有一个JAVA应用是用JDBC连接远程ORACLE数据库的,请问安装JAVA应用的主机要不要安装ORACLE客户端?
- 15分,快来看看!
- 菜鸟提问:javax.naming.NameNotFoundException: Name "comp/env/Aaa" not found in context "java:".
- 眩晕,眩晕,救人,救人,给分,给分
- ejb,j2ee学习的例子
- 用ant的时候调用junit的问题
- hibernate 影射文件编辑工具哪个好
为<html:form>增加onsubmit属性
设置Javascript支持 下表中列出了一JSP文件的示例代码,红字部分为Javascript验证所需代码。
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<table bgcolor="#9AFF9A" cellspacing="0" cellpadding="10" border="1" width="100%">
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr bgcolor="#696969">
<td align="center">
<font color="#FFFFFF">Panel 3: Profile</font>
</td>
</tr>
<tr>
<td><br>
<html:errors/>
<html:form action="/login.do" focus="username" onsubmit="return validateLoginForm(this);">
<html:hidden property="actionClass"/>
<center>
<table>
<tr>
<td>UserName:</td>
<td><html:text property="username" size="20"/></td>
</tr>
<tr>
<td>Password:</td>
<td><html:password property="password" size="20"/></td>
</tr>
<tr>
<td colspan=2><html:submit property="submitProperty" value="Submit"/></td>
</table>
</center>
</html:form>
<html:javascript formName="loginForm" dynamicJavascript="true" staticJavascript="false"/>
<script language="Javascript1.1" src="staticJavascript.jsp"></script>
</td>
</tr>
</table>
</td>
</tr>
</table> 其中onsubmit的值为"return validateLoginForm(this);",它的语法为:return validate + struts-config.xml中定义的form-bean名称 + (this);staticJavascript.jsp的内容为:
<%@ page language="java" %>
<%-- set document type to Javascript (addresses a bug in Netscape according to a web resource --%>
<%@ page contentType="application/x-javascript" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:javascript dynamicJavascript="false" staticJavascript="true"/> 如果validator-rules.xml中定义的基本验证功能不能满足你的需求,你可以自己添加所需的验证类型
就是有style="display=none"的页面不行,我页面元素比较多所以用table分区来显示,隐藏的
因为struts的javascript函数校验的时候如果发现不符合要求便会把焦点转移到所验证的控件上,如果此控件为隐藏的,则会失败.