• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems passing '%' and '&' as params in jsp:include

 
Roger Graff
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting an IllegalArgumentException when I try to pass "% abc" or "& abc" as a param to a jsp:include tag.
I'm using Tomcat 3.2.3, BTW.
In main.jsp

In testChar.jsp

Exception:

I've tried using URLEncoder.encode() and URLDecoder.decode(), but the parameter isn't a URL so that's causing other issues.
Any ideas?
 
Mehta Saryu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
follow this link : this is not the exact answer but you may find a clue.
http://www.coderanch.com/t/282310/JSP/java/Passing-cent-symbol-jsp-servlet
 
Roger Graff
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just can't accept that URLEncoder/URLDecoder needs to be used to pass variables in the request object. This variable isn't part of a URL, it's just a variable that's getting stored in the request object and sent to another JSP.
Perhaps I'm missing something in the underlying HTTP protocol that's passing the request from one JSP to the next. ???
When I tried using the encoder classes, the resulting string was encoded, but the string had even more % and & characters in it than before.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!