• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Javascript code exploding the JSLT validation

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you find out why the following jsp page


throws
the following exception .

PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c in /app/sdv/test.jsp</h3><p>null: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1b) was found in the CDATA section.</p>



I am using JSTL 1.1 core library with tlib-version 1.1 & Tomcat 5.5 on Linux
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes youi think that this is related to the JavaScript on your page?

uri="/WEB-INF/tld/c.tld"



What is c.tld doing outside of the jar file?

Did you extract the tld file and place it in the file system?

If so, this is the first thing to clean up.
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I remove this line


There is no exception
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's odd. What about my other questions?
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to recreate this problem. That's the good news...

P.S. That doesn;t mean that you shouldn;t consider cleaning up your setup. There is no reason for c.tld to be repeated in the file system.
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears as if the character sequence \$ is being converted to an escape character (0x1b) by the JSP translator, which is subseuquently tripping up the JSTL validator.

You could try clever escaping to try to avoid this, but it might just be easier to hack it by separating the $ from the preceding slash with something like:



which makes me gag, but avoids the issue.
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot
I fixed the issue with the following code


But this is a big limitation that you have to be very carefull in writting javascript code when you incluse JSTL

isn't it ?

When I tried to use c.tld in the jar file for the following code I got compilation error.


According to TLD or attribute directive in tag file, attribute value does not accept any expressions



but when I extracted it to the file system and used it, it worked fine .
 
ice is for people that are not already cool. Chill with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic