Results 1 to 4 of 4

Thread: valang and function in error parameters

  1. #1
    Join Date
    Jul 2005
    Posts
    13

    Unhappy valang and function in error parameters

    Hi, I am trying to integrate valang validation, however, I can't make use of function in error_parameters.

    Code:
    { name : ? is not blank : 'name is required' : 'errors.required' : resolve('label.username') }
    this valang rule gives exception:

    Code:
    org.springmodules.validation.valang.parser.ParseException: Encountered "}" at line 3, column 142.
    
    Was expecting:
    
        "," ...
    however, I do something like
    Code:
    { name : ? is not blank : 'name is required' : 'errors.required' : resolve('label.username') }
    and valang works flawlessly, although the errors.required only requires one parameter, i.e.

    Code:
    errors.required={0} is mandatory
    Is there anyone able to use function in error_parameters that can point me out what I have done wrongly ? I read the Spring module reference manual and didn't find example about function in error_parameters. Thanks.

    P.S. I am using Spring Framework 2.0RC4 + Spring modules 0.6

  2. #2
    Join Date
    Nov 2006
    Posts
    1

    Default

    Has anyone figured this out yet? I am having the same problem.

    the code below produces the error mentioned in the original post.

    Code:
    { name : ? has text : 'name is required' : 'errors.required' : resolve('name')  }
    this code does not pull the argument from the resources file:

    Code:
    { name : ? has text : 'name is required' : 'errors.required' : 'name'  }

  3. #3
    Join Date
    Dec 2006
    Posts
    8

    Default

    I am running into the same issue and have tried different combinations but none seem to work. Has anyone got this to work?

  4. #4

    Default

    Include ORO jar files it will solve your problem. It is a expression parser
    Last edited by buntyindia; Oct 6th, 2007 at 03:03 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •