The latest code does not suffer this problem. The latest cvs in
turbine-2 and fulcrum does not match up at all with the line numbers in
question, so you will have to wait till i check out the 2.1 source code
or i might be able to give a quick answer if someone would paste the
Field.validate method and show line 515. it would seem the validator is
not even getting called, since i do not see how it could pass the test,
but i cannot know until i see the correct source code.
john mcnally
Diogo wrote:
>
> I've defined a Group in my intake.xml groups that is mapped to one of mine BO.
> I have one field that represents an INT property in my class
>
> <field name="counter" key="counter" type="int">
> <rule name="maxLength" value="3">
> The counter may have 3 nubmer only!.
> </rule>
> <rule name="mask" value="^([0-9]*)$">.Wrong syntax.</rule>
> </field>
>
> My problem is that when I call Intake.isAllValid() and my input text is filled with
>things that are NOT number I get the following exception instead of reloading my
>screen with the error defined in my rule......
>
> [Mon Sep 24 14:54:05 GMT-03:00 2001] -- ERROR --
> Exception: java.lang.NumberFormatException: aaa
> Stack Trace follows:
> java.lang.NumberFormatException: aaa
> at java.lang.Integer.parseInt(Integer.java:406)
> at java.lang.Integer.<init>(Integer.java:541)
> at
>org.apache.turbine.services.intake.model.IntegerField.doSetValue(IntegerField.java:100)
> at org.apache.turbine.services.intake.model.Field.validate(Field.java:515)
> at org.apache.turbine.services.intake.model.Field.init(Field.java:263)
> at org.apache.turbine.services.intake.model.Group.init(Group.java:204)
> at org.apache.turbine.services.intake.model.Group.getObjects(Group.java:310)
> at org.apache.turbine.services.intake.IntakeTool.init(IntakeTool.java:131)
> at
>org.apache.turbine.services.pull.TurbinePullService.populateWithRequestTools(TurbinePullService.java:479)
> at
>org.apache.turbine.services.pull.TurbinePullService.populateContext(TurbinePullService.java:415)
> at
>org.apache.turbine.services.pull.TurbinePull.populateContext(TurbinePull.java:145)
> at
>org.apache.turbine.services.velocity.TurbineVelocityService.getContext(TurbineVelocityService.java:218)
> at
>org.apache.turbine.services.velocity.TurbineVelocity.getContext(TurbineVelocity.java:140)
> at
>org.apache.turbine.modules.pages.VelocityPage.doBuildBeforeAction(VelocityPage.java:84)
> at org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:137)
> at org.apache.turbine.modules.Page.build(Page.java:90)
> at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:123)
> at org.apache.turbine.Turbine.doGet(Turbine.java:447)
> at org.apache.turbine.Turbine.doPost(Turbine.java:537)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:204)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:302)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:329)
> at com.evermind.server.http.d3.sw(JAX)
> at com.evermind.server.http.d3.su(JAX)
> at com.evermind.server.http.ef.s1(JAX)
> at com.evermind.server.http.ef.do(JAX)
> at com.evermind.util.f.run(JAX)
>
> Diogo Saad.
> [EMAIL PROTECTED]
> Inter Business Tecnologia e Servi�os
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]