Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Architecture & Framework » Struts  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Struts Validator有没有办法只生成一些我们定制的?共用的进行引入
YuLimin

简单就是美

版主


发贴: 866
积分: 123
于 2005-03-23 17:18 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Struts Validator是在表单里动态生成很多共用的JS,有没有办法只生成一些我们定制的,共用的用<script language="javascript" src="../js/Common.js"></script>进行引入?

比如:
validateMaxLength()
validateRequired()
validateDate()

.....

一个页面全部是JS代码,大的不得了。



 当兵不后悔!后悔不当兵! 
超越黎明时空,追逐时代潮流!
人,是要靠自己的!简单就是美!
我的Java:http://www.Java2Class.net
我的Blog:http://YuLimin.ItEye.com
作者 Re:Struts Validator有没有办法只生成一些我们定制的?共用的进行引入 [Re:YuLimin]
jigsaw

KK

CJSDN高级会员


发贴: 3666
积分: 93
于 2005-03-26 02:04 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
i never use struts validator...
u may need to implement ur validation-rules.xml and ur validator plugin..
or u can try to remove some un-used nodes from validation-rules.xml



No one knows except both of us.
909090909090909090909090909090909090909090b8533ce76c8d6c241868968a0408c338b4ffbf
ISO/IEC 9899:1999
作者 Re:Struts Validator有没有办法只生成一些我们定制的?共用的进行引入 [Re:YuLimin]
floater

Java Jedi

总版主


发贴: 3233
积分: 421
于 2005-03-26 03:06 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
yes, I am having the same issue, just don't have time to think about this.

I am still believing, there is no such thing, like a javascript framework. The reason is just what you said, the overhead in size is too big. Once someone gave me this js framework, it was about 110K in size. Does anyone want to download a 5K page with 110K javascript embedded?

Nontheless, it seems a lot of people buying in this validator lib, for its simplicity to use, do some setup and then it's there. In this case, we shouldn't manually to change it at all, let the tool do the dirty job. So my advice is "Forget it, it's not worth it" - quote from the snowman, threatened by the rabbit with a hairdryer.



"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler, Refactoring - Improving the Design of Existing Code

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923