@Daniel:
Of course I do not use OGNL for only selecting an entry from a simple Map.
My application uses OGNL for navigating thru a complex (unknown) graph and 
doing calculations based on the values inside the graph.
I just gave a simple example to explain my needs...


@Chris:
I have tried this already. If I write Ognl.getValue("\"a-b\"", m), OGNL 
interprets 'a-b' as a String and returns it instead of trying to get the 
value for the 'a-b'-key from m.

Thanks,
Stephan

Daniel Pitts <[email protected]> schrieb am 05.03.2012 21:09:41:

> Von: Daniel Pitts <[email protected]>
> An: Commons Users List <[email protected]>
> Kopie: Commons Users List <[email protected]>
> Datum: 05.03.2012 21:34
> Betreff: Re: [OGNL] Mask operators
> 
> Or more simply m.get("a-b") :-)
> 
> OGNL is a great tool. But don't use it where it doesn't help. 
> 
> Thanks,
> Daniel.
> 
> Sent from my iPhone
> 
> On Mar 5, 2012, at 8:20 AM, Chris Pratt <[email protected]> wrote:
> 
> > Try getValue("\"a-b\"");
> >  (*Chris*)
> > On Mar 5, 2012 4:54 AM, <[email protected]> wrote:
> > 
> >> Is there a way to mask operators in ognl so that they do not get
> >> interpreted as operators?
> >> 
> >> Example:
> >> I have a Map m which contains a key 'a-b'
> >> If I write Ognl.getValue("a-b", m), Ognl tries to find a and b inside 
the
> >> map and subtracts b from a.
> >> But what I want is to get the key named 'a-b'.
> >> I already tried to use a backslash: Ognl.getValue("a\\-b", m) but 
this is
> >> not accepted by Ognl (Malformed OGNL expression).
> >> 
> >> Any ideas?
> >> ----------------
> >> Disclaimer:
> >> Diese Nachricht dient ausschließlich zu Informationszwecken und ist 
nur
> >> für den Gebrauch des angesprochenen Adressaten bestimmt.
> >> 
> >> This message is only for informational purposes and is intended 
solely for
> >> the use of the addressee.
> >> ----------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

----------------
Disclaimer:
Diese Nachricht dient ausschließlich zu Informationszwecken und ist nur 
für den Gebrauch des angesprochenen Adressaten bestimmt.

This message is only for informational purposes and is intended solely for 
the use of the addressee.
----------------

Reply via email to