Re: invalid characters?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jun 27 2005 - 12:48:08 EDT

  • Next message: Dhruti Ramani: "Removing Object from list but not from database"

    Just to doublecheck - you are not using ExpressionFactory? Cause
    identifiers passed to ExpressionFactory shouldn't cause this error.

    Rereading your message (and if you use Expression.fromString()) I
    think the problem is not so much with what chars are not allowed (all
    of them are). Rather it is caused by the fact that they are not
    escaped properly. So if you have a text field in your UI where users
    enter a literal value, you can simply escape "special" chars
    prefixing them with a backslash in your code before passing it to
    "fromString".

    I guess you can start by escaping single and double quote chars.

    Andrus

    On Jun 27, 2005, at 12:29 PM, Andrus Adamchik wrote:

    > Expressions structure is shown here: http://objectstyle.org/cayenne/
    > grammar/ExpressionParser.html
    >
    > Unfortunately this page (generated by JavaCC) doesn't show what
    > valid tokens consist of. For token definitions you'll have to look
    > into a JavaCC grammar definition file:
    >
    > http://cvs.sourceforge.net/viewcvs.py/cayenne/cayenne/src/cayenne/
    > java/org/objectstyle/cayenne/exp/parser/ExpressionParser.jjt?
    > rev=1.12&view=markup
    >
    > Andrus
    >
    >
    > On Jun 26, 2005, at 2:15 PM, Koen Segers wrote:
    >
    >
    >
    >
    >> Hi,
    >>
    >> Can anyone tell me what the invalid characters are in a cayenne
    >> expression?
    >>
    >> I get this exception when I add a ' to a field:
    >> org.objectstyle.cayenne.exp.ExpressionException
    >>
    >> Obvious this is an error...
    >> I want to give the user a message which characters aren't allowed.
    >>
    >> Probably there is a url that tells this all, but I can't find it.
    >>
    >> Greetz
    >> --
    >>
    >> Koen Segers
    >>
    >> <koenseger..carlet.be>
    >> <http://eddyvite.dyndns.org>
    >>
    >>
    >>
    >>
    >>
    >
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon Jun 27 2005 - 15:07:51 EDT