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
  • 16,868
  • 6
  • 60
  • 93
Will
  • 443
  • 8
  • 28

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 }" />
Will
  • 443
  • 8
  • 28