这个到没试过,不过我是用STRUTS的。
解决方案 »
- MyFaces入门
- j2ee中DispatchAction类如何对应form
- struts2,防止多次提交button disable 的一个问题
- 实现hibernate的一对多时,List中出现很多null,怎么回事?
- 请各位apache与tomcat整合的问题
- 谁能改改我的代码在Frame上面画个圆圈?
- 请问大家介绍一些比较好的缓存包,谢谢。
- 怎么在VB.NET中添加新控件??
- 关于cmp中update主键的问题
- tomcat startup.bat 运行时,大概到Hibernate绑定Bind entity 时突然退出,怎么办?
- ofbiz在weblogic上如何配置?
- 求教:是否有直接用JDBC访问EXCEL文件的包?而不通过JDBC-ODBC桥?
然后在javascript中提交另外的form表单。服务器端根据提交的表单调用ejb处理检查只是可能要用到iframe
public class CheckForm{
/* public: JavaScript 声明 */
String CheckFormStr;
/* public: 表单名称 */
public String formName;
public void setFormName(String formName){
this.formName = formName;
} /***************************************************************************\
* public: constructor functions
* 构造函数
\***************************************************************************/
public CheckForm(){
this.CheckFormStr =
"<script ID=clientEventHandlersJS language=javascript>" + "\n" +
"<!--" + "\n";
this.neededFunction(); // load the needed functions
this.CheckFormStr +=
"function CheckTheForm() {" + "\n";
} /***************************************************************************\
* public: export javascript script
* 输出 JAVASCRIPT 脚本
\***************************************************************************/
public String CheckFormScript() {
this.CheckFormStr +=
"return(true);" + "\n" +
"}" + "\n" +
"-->" + "\n" +
"</script>" + "\n";
return this.CheckFormStr;
} /***************************************************************************\
* public: check the numeric
* 检查录入框值是否是数字
\***************************************************************************/
public void numericCheck(String inputName, String CheckMsg) {
this.CheckFormStr +=
" if(fucCheckNUM(document."+formName+"."+inputName+".value) == 0) {" + "\n" +
" alert(\""+CheckMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
}jsp调用:
CheckForm.numericCheck("number","对不起,号码只能输入数字!");但这样会使服务器开销比较大的,不是很好的办法。