0

I need to decode a URL/URI with JSTL so that an encoded string such as:

%3Fname%3DUpHelix

becomes:

?name=UpHelix

I know you can use URLDecoder in regular java but I don't know how to pull it off in JSTL.

Is there a JSTL method that will accomplish this?

Mechlar
  • 4,946
  • 12
  • 58
  • 83
  • 4
    No. Do it in the controller, or create your own tag. – JB Nizet May 13 '13 at 21:51
  • If you don't have a controller and you don't want to use a tag, then you could use the JSTL EL function called replace. I hesitate to post the code because scripting in JSP is really frowned on here at SO. But, if you asked me for the hack, then I will provide it. – rickz May 14 '13 at 02:47
  • @JB Nizet, taking your advice on this one. Go ahead and post an answer similar to your comment and I will accept that. – Mechlar May 15 '13 at 15:35

1 Answers1

2

There is no standard tag to do that. So you should do it in the controller, or create your own tag that does it and use this tag in the JSP.

This doesn't look like view logic (i.e. markup generation logic) to me, so the best place is probably in the controller.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255