• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

 
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?
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!