NimChimpsky
NimChimpsky

Reputation: 47280

Java properties file that uses percent sign "%"

In my properties file I have

key=cheese
key%dutch=gouda
key%french=brie

I can reference in my jsp code :

<t:if condition="${key eq 'cheese'}">

but how to reference (this doesn't work):

<t:if condition="${key%dutch eq 'cheese'}">

Upvotes: 1

Views: 1325

Answers (2)

Bruno Franco
Bruno Franco

Reputation: 2037

Unfoturnaly, inside an Expression Language, the simbol % means mod, so, you can't make reference to this key property on this way.

Upvotes: 0

JB Nizet
JB Nizet

Reputation: 691635

Assuming the key is used as the name of a request attribute, you can use

${requestScope['key%dutch'] eq 'cheese'}

(For the other scopes, use pageScope, sessionScope or applicationScope).

Or you could change these keys to something more suitable.

Upvotes: 1

Related Questions