*
The moose likes JSP and the fly likes Javascript code exploding the JSLT validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Javascript code exploding the JSLT validation" Watch "Javascript code exploding the JSLT validation" New topic
Author

Javascript code exploding the JSLT validation

Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
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


I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
If I remove this line


There is no exception
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

That's odd. What about my other questions?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

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

Joined: May 03, 2001
Posts: 163
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 .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Javascript code exploding the JSLT validation
 
Similar Threads
prototype framework with ajax in struts 2 'jsp
Calling a new JSP form a Spring Controller using Ajax
Setting dynamic parameter values?
Problem in using javascript in spring web mvc system:
ServletException: bean not found within scope