You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Fight Ice <ri...@hotmail.com> on 2012/03/28 15:01:40 UTC
Form component's validate parameter cause excpetions when clients
use zh-cn language
When the client web browser use the zh_cn locale to load my login page, i get a exception like this :
Render queue error in BeginRender[admin/Login:username]: d != java.lang.String
but if client use the en locale, it works correctly.
if i want to use zh_cn locale to load my login page, i found that if i use minlength validator and other similar validators, i'll get exceptions.
Login.java(partial)
@Persist
@Property
private String userName;
@Property
private String password;
Login.tml(partial)
<t:form t:id="loginForm">
<t:errors/>
<t:label for="userName"/>
<t:TextField t:id="userName" t:validate="required, minlength=6" size="30"/>
<br/>
<t:label for="password"/>
<t:PasswordField t:id="password" t:validate="required, minlength=6" size="30"/>
<br/>
<input type="submit" value="Login"/>
</t:form>
If i just use required validator, it works.
Re: Form component's validate parameter cause excpetions when clients
use zh-cn language
Posted by Lance Java <la...@googlemail.com>.
https://issues.apache.org/jira/browse/TAP5-1865
On Wednesday, 28 March 2012, Fight Ice <ri...@hotmail.com> wrote:
>
> When the client web browser use the zh_cn locale to load my login page, i
get a exception like this :
> Render queue error in BeginRender[admin/Login:username]: d !=
java.lang.String
>
> but if client use the en locale, it works correctly.
> if i want to use zh_cn locale to load my login page, i found that if i
use minlength validator and other similar validators, i'll get exceptions.
>
> Login.java(partial)
>
> @Persist
> @Property
> private String userName;
>
> @Property
> private String password;
>
> Login.tml(partial)
>
> <t:form t:id="loginForm">
> <t:errors/>
> <t:label for="userName"/>
> <t:TextField t:id="userName" t:validate="required, minlength=6"
size="30"/>
> <br/>
> <t:label for="password"/>
> <t:PasswordField t:id="password" t:validate="required,
minlength=6" size="30"/>
> <br/>
> <input type="submit" value="Login"/>
> </t:form>
>
> If i just use required validator, it works.
>
RE: Form component's validate parameter cause excpetions when
clients use zh-cn language
Posted by Fight Ice <ri...@hotmail.com>.
Thanks!
just add two lines to the app.properties:
minimum-string-length=\u60a8\u5fc5\u987b\u4e3a %2$s \u63d0\u4f9b\u81f3\u5c11 %1$d \u5b57\u7b26\u3002
maximum-string-length=\u60a8\u6700\u591a\u80fd\u4e3a %2$s \u63d0\u4f9b\u81f3\u5c11 %1$d \u5b57\u7b26\u3002
All works correctly!
Re: Form component's validate parameter cause excpetions when clients
use zh-cn language
Posted by Rural Hunter <ru...@gmail.com>.
check this:
http://tapestry.1045711.n5.nabble.com/A-strange-error-with-MaxLength-Validator-td5546700.html
δΊ 2012/3/28 21:01, Fight Ice ει:
> When the client web browser use the zh_cn locale to load my login page, i get a exception like this :
> Render queue error in BeginRender[admin/Login:username]: d != java.lang.String
>
> but if client use the en locale, it works correctly.
> if i want to use zh_cn locale to load my login page, i found that if i use minlength validator and other similar validators, i'll get exceptions.
>
> Login.java(partial)
>
> @Persist
> @Property
> private String userName;
>
> @Property
> private String password;
>
> Login.tml(partial)
>
> <t:form t:id="loginForm">
> <t:errors/>
> <t:label for="userName"/>
> <t:TextField t:id="userName" t:validate="required, minlength=6" size="30"/>
> <br/>
> <t:label for="password"/>
> <t:PasswordField t:id="password" t:validate="required, minlength=6" size="30"/>
> <br/>
> <input type="submit" value="Login"/>
> </t:form>
>
> If i just use required validator, it works.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org