Im 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 complition 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
What kind of errors are you getting? JSP syntax errors should not be dependent on the JSP compiler, since the JSP syntax is defined in the JEE JSP standard spec. The only exception is if you had a version mismatch on JSP spec levels between the compiler and the source JSPs.
An IDE is no substitute for an Intelligent Developer.
Hey thanks for the quick response.
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.
When running our web app in Tomcat 6 some of the exceptions we get are :
* /general/_quickLinksElement.jsp(25,16) 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.
Also ive read that we can replace Tomcat's default JSP compiler with Jikes
So for a quick fix 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.
Oh boy. This sounds like a "Git 'R Dun!" edict from Management.
Never time or budget to do it right, just "fix it" and wait for it to break again. Well, as they say, you can pay now or you can pay later, but you'll still pay.
There's a hint in your error message that what you may actually need is some custom JSP taglib(s). If that's the case, maybe you don't need such extreme measures. You may just need to setup the taglib. Also maybe fix some stuff where you've got quotes embedded within quotes, since THAT problem is only going to get worse as time goes by.
Jikes is/was an IBM JDK noted for high performance. I actually don't know if it's still around under that name, although IBM does still field JDK products. I think the one they recommend these days is J9. Regardless, while IBM does have its quirks, I doubt replacing the Java compiler will help.
As for replacing the JSP compiler, there used to be instructions in the documentation at http://tomcat.apache.org, I think. Should still be, if this is still a supported feature. Whether you can bodily substitute the resin JAR into Tomcat without it getting into classpath fights over servlets and other stuff I don't know.
Joined: Dec 09, 2010
thanks for all the help.I fixed all the code breaks and now the application works brilliantly with Tomcat 6.