tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Bednarz" <>
Subject JSP Escape character problem - PLEASE HELP
Date Thu, 10 Jan 2002 16:27:48 GMT

I have a problem that could be a bug somewhere inside the JSP compiler. I have ported an application
from JRun 3.0 to TOMCAT. The following code inside a JSP causes an Exception:

---- snip ----
	<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
	if (isMenu) 
		if (UserRole.compareTo("Echnaton Administrator") == 0) // Administrators with full access
			out.print("document.write(\"<SCRIPT LANGUAGE='JavaScript1.2' SRC='/Echnaton/Scripts/hierArrays_Admin.js'><\/SCRIPT>\");");
		else if (UserRole.compareTo("Echnaton Technician") == 0) // Technical Users
			out.print("document.write(\"<SCRIPT LANGUAGE='JavaScript1.2' SRC='/Echnaton/Scripts/hierArrays_Tech.js'><\/SCRIPT>\");");
			out.print("document.write(\"<SCRIPT LANGUAGE='JavaScript1.2' SRC='/Echnaton/Scripts/hierArrays_User.js'><\/SCRIPT>\");");

---- snip ----------------

Jasper reports the following exception:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occured between lines: 141 and 148 in the jsp file: /Header.jsp

Generated servlet error:
C:\JavaSoft\Tomcat4.0\work\localhost\Echnaton\Header$ Invalid escape character.
                			out.print("document.write(\"<SCRIPT LANGUAGE='JavaScript1.2' SRC='/Echnaton/Scripts/hierArrays_Admin.js'><\/SCRIPT>\");");

Exactly this code works perfectly fine in JRun! It seems like the parser could not handle
the escaped quotation mark in the document.write() method. Could anybody help? I am currently
working with Tomcat 4.0.1. I have downloaded the binaries only (for M$ Windows).

Many thanks!!


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message