Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Escape Dollar Sign in Valang Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Escape Dollar Sign in Valang

    I have a form command object with a property named mail$from. Just in case some of you are thinking of it, nevermind that the property has a dollar sign in it. This is legal Java.

    Anyway, the following code declares this property:
    Code:
    @Email(message="The mail from address must be a valid email address", applyIf="mail$from HAS LENGTH")
    private String mail$from;
    When I attempt to validate this, I get the following error:

    Code:
    org.springmodules.validation.valang.parser.TokenMgrError: Lexical error at line 1, column 5.  Encountered: "$" (36), after : ""
    	at org.springmodules.validation.valang.parser.ValangParserTokenManager.getNextToken(ValangParserTokenManager.java:2649)
    	at org.springmodules.validation.valang.parser.ValangParser.jj_scan_token(ValangParser.java:1684)
    	at org.springmodules.validation.valang.parser.ValangParser.jj_3_4(ValangParser.java:1245)
    	at org.springmodules.validation.valang.parser.ValangParser.jj_2_4(ValangParser.java:946)
    	at org.springmodules.validation.valang.parser.ValangParser.function(ValangParser.java:515)
    	at org.springmodules.validation.valang.parser.ValangParser.multiplicativeExpr(ValangParser.java:643)
    	at org.springmodules.validation.valang.parser.ValangParser.subtractiveExpr(ValangParser.java:615)
    	at org.springmodules.validation.valang.parser.ValangParser.additiveExpr(ValangParser.java:587)
    	at org.springmodules.validation.valang.parser.ValangParser.predicate(ValangParser.java:348)
    	at org.springmodules.validation.valang.parser.ValangParser.expression(ValangParser.java:324)
    	at org.springmodules.validation.valang.parser.ValangParser.predicates(ValangParser.java:262)
    	at org.springmodules.validation.valang.parser.ValangParser.parseExpression(ValangParser.java:154)
    	at org.springmodules.validation.util.cel.valang.ValangConditionExpressionParser.parse(ValangConditionExpressionParser.java:35)
    	at org.springmodules.validation.bean.conf.loader.annotation.handler.AbstractPropertyValidationAnnotationHandler.extractApplicabilityContidion(AbstractPropertyValidationAnnotationHandler.java:197)
    	at org.springmodules.validation.bean.conf.loader.annotation.handler.AbstractPropertyValidationAnnotationHandler.handleAnnotation(AbstractPropertyValidationAnnotationHandler.java:121)
    	at org.springmodules.validation.bean.conf.loader.annotation.AnnotationBeanValidationConfigurationLoader.handleProprtyAnnotations(AnnotationBeanValidationConfigurationLoader.java:281)
    	at org.springmodules.validation.bean.conf.loader.annotation.AnnotationBeanValidationConfigurationLoader.handlePropertyAnnotations(AnnotationBeanValidationConfigurationLoader.java:238)
    	at org.springmodules.validation.bean.conf.loader.annotation.AnnotationBeanValidationConfigurationLoader.createValidationConfiguration(AnnotationBeanValidationConfigurationLoader.java:165)
    	at org.springmodules.validation.bean.conf.loader.annotation.AnnotationBeanValidationConfigurationLoader.loadConfiguration(AnnotationBeanValidationConfigurationLoader.java:105)
    	at org.springmodules.validation.bean.BeanValidator.validateObjectGraphConstraints(BeanValidator.java:174)
    	at org.springmodules.validation.bean.BeanValidator.validate(BeanValidator.java:99)
    I have tried escaping the dollar sign with single quotes ("'$" and "'$'"), double quotes ('"$', '"$"'), back-slashes ("\\$"), double back-slashes ("\\\\$"), and extra dollar signs ("$$"). These all only cause different lexical errors. I've looked everywhere online, searched through these forums, searched Google, etc., to no avail.

    So, how are you supposed to escape a dollar sign in a Valang expression within an expression field in a Spring Modules validation annotation parameter?

    Thanks.

  • #2
    So, nobody has any ideas?

    Thanks in advance for an help...

    Comment

    Working...
    X