yin jiang

Greenhorn
+ Follow
since Mar 28, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by yin jiang

I think it's impossible unless you write your own javascript validate function for validwhen.
18 years ago
Struts validation do client-side (JavaScript) validation for indexed properties too.

you can write your validation.xml file as this :

<field property="approver[0]" depends="short">
<msg name="short" key="errors.user.id.not.int"/>
</field>
<field property="approver[1]" depends="short">
<msg name="short" key="errors.user.id.not.int"/>
</field>

One problem I am facing now is the client-side validation will import all validate scripts even if you don't need them. It will make your HTML page very big.
18 years ago
<title><tiles:insert attribute="title" flush="true"/></title>

<tiles:insert> Tag is a Tag to insert a page at the place of this tag. But your title is not a page, but a string. So chage this line to :

<title><tiles:getAsString name="title" /></title>
18 years ago
validwhen validation can only be done on server side.
18 years ago
What is your easy struts version?
I'm using easy struts 0.6.4 with eclipse 2.1.3.
And I think easy struts 0.6.4 can't work with eclipse 3.0 and above.
18 years ago
validwhen validation will only be done on server-client.
18 years ago
I have the same question. Below is my code:
================JSP CODE START===============
<html:form action="/setuser" >
<% for (int i = 0; i < LENGTH; i ++ ) { %>
<tr><td align="center"><html:text property='<%= "user[" + i + "]"%>' size="4" maxlength="4"/></td>
<% } %>
</html:form>
================JSP CODE END=================

================struts-config.xml start=========
<form-bean name="setuserForm" type="cn.justsystem.struts.form.SetuserForm">
<form-property size="9" name="users" type="java.lang.String[]" />
</form-bean>
================struts-config.xml end=========

I'm writing my validation.xml as below:
================validation.xml start===============
<form name="setuserForm">
<field property="users[0]" depends="short">
<msg name="short" key="errors.short"/>
</field>
</form>
================validation.xml end=================

But if i want to validate all of users property with save validation rules, i have to write the same part as above nine times.
Are there any good way to validate them?
Thanks!
18 years ago