1

I'm moving my application server from Resin to Tomcat 6. In the process I am facing lots of problems wrt to JSP compilation. (receive loads of JasperExceptions due to syntax errors). My JSP's using JSTL 1.1 compile and run smootly in Resin .

Is there any way i can use Resin's JSP compilation class i.e "com.caucho.jsp.JspCompiler" instead of the Jasper compiler provided in Tomcat 6.

In short Tomcat to use a specific complier instead of Jasper

Cœur
  • 37,241
  • 25
  • 195
  • 267
Reinwald
  • 11
  • 1
  • Which errors exactly are you facing? Please name some. – BalusC Dec 09 '10 at 20:45
  • The problem is that we have not conformed to JSP spec and the Resin compiler was not throwing any exceptions (com.caucho.jsp.JspCompiler present in Resin.jar) .Now in Tomcat the articles tell me it very strict wrt to the JSP standard spec. – Reinwald Dec 11 '10 at 06:59
  • When running our web app in Tomcat 6 some of the exceptions we get are : *the function contains must be used with a prefix when a default namespace is not specified * Attribute value is quoted with " which must be escaped when used within the value. – Reinwald Dec 11 '10 at 06:59

1 Answers1

0

Have you downloaded and added the JSTL library to your application? Resin appears to include JSTL in their distribution, Tomcat does not.

Given the sample jsp running on Tomcat

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<body>
    <h1>
    <c:out value="Hello World" />
    </h1>
</body>
</html>

before installing the JSTL Libraries, tomcat gives the following error

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)

Once installing the JSTL libraries (Download Link) the error goes away and Hello World is printed to the screen.

Since you have not shown us the error, I will assume your error is probably similar. There should be no need to change which compiler is used.

Sean
  • 7,597
  • 1
  • 24
  • 26
  • Ive use the appropriate JSTL libraries. The issue is I am migrating my web app that has approx around 200 jsps from Resin 3.1.3 to Tomcat 6. The problem is that we have not conformed to JSP spec and the Resin compiler was not throwing any exceptions (com.caucho.jsp.JspCompiler present in Resin.jar) .Now in Tomcat the articles tell me it very strict wrt to the JSP standard spec. – Reinwald Dec 11 '10 at 06:57
  • When running our web app in Tomcat 6 some of the exceptions we get are : *the function contains must be used with a prefix when a default namespace is not specified * Attribute value is quoted with " which must be escaped when used within the value. – Reinwald Dec 11 '10 at 06:58
  • Is there any way I can disable the Jasper compiler and use com.caucho.jsp.JspCompiler present in Resin.jar as the JSP compiler in Tomcat. – Reinwald Dec 11 '10 at 06:58