• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javascript code exploding the JSLT validation

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I remove this line


There is no exception
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's odd. What about my other questions?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Just the other day, I was thinking ... about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic