0

I would like to construct a string with "%" in it in a <c:set> tag.

Here it goes:

<c:set var="test" value="${somethingA + '%' }" />

But this always give me a number format exception.

java.lang.NumberFormatException: For input string: "%"

So how do I work around this?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
user6332430
  • 442
  • 10
  • 29

1 Answers1

2

For those who wonder the same.

<c:set var="test" value="${somethingA }%" />

If there are more to come after the %, simply do

<c:set var="test" value="${somethingA }%${somethingElse }" />
user6332430
  • 442
  • 10
  • 29