Topic: Struts Validator有没有办法只生成一些我们定制的?共用的进行引入

  Print this page

1.Struts Validator有没有办法只生成一些我们定制的?共用的进行引入 Copy to clipboard
Posted by: YuLimin
Posted on: 2005-03-23 17:18

Struts Validator是在表单里动态生成很多共用的JS,有没有办法只生成一些我们定制的,共用的用<script language="javascript" src="../js/Common.js"></script>进行引入?

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

.....

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

2.Re:Struts Validator有没有办法只生成一些我们定制的?共用的进行引入 [Re: YuLimin] Copy to clipboard
Posted by: jigsaw
Posted on: 2005-03-26 02:04

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

3.Re:Struts Validator有没有办法只生成一些我们定制的?共用的进行引入 [Re: YuLimin] Copy to clipboard
Posted by: floater
Posted on: 2005-03-26 03:06

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.


   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