aspose file tools*
The moose likes Tomcat and the fly likes Getting JSPs on Tomcat server to recognize XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Getting JSPs on Tomcat server to recognize XML" Watch "Getting JSPs on Tomcat server to recognize XML" New topic
Author

Getting JSPs on Tomcat server to recognize XML

jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
I've downloaded JAXP and put all sorts of jars into the classpath (jaxp.jar, xerces.jar, xmlparser.jar, etc). All of my JSPs work fine, unless I use XML notation, at which point I get errors like this from Tomcat:
org.apache.jasper.JasperException: Unable to compile class for JSP

If I do a <%@ page import="java.util.Date"%>, works great. If I do <jsp : directive.page import="java.util.Date"/> (space there to keep the big smiley from showing) it gives me that error. None of the JSPs with XML work. Do I need to copy a jar into one of the Tomcat folders?
(I removed entries for jar files that didn't appear to work, so my classpath isn't flooded with conflicting jars).
Thanks for any help
Jason
[ February 13, 2002: Message edited by: jason adam ]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

What about putting the jaxp jars into the lib folder of *only* the application that uses them, and leaving them off the classpath, or out of <CATALINA_HOME>/common/lib, so that Tomcat can use the parsers it expects, and your application will (hopefully?) use the ones in it's own application directory.

I forget if the classloader starts at the bottom or the top... so this might not work. ;(
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Tomcats Boot Library contain all the jars that it needs for XML translation if JSP Documents. With out seeing your JSP Document I can only guess that you forgot the first step. Check out Exploring JSP Documents
Tomcat uses the exsistance of the jsp: root element to shift to the xml parser it uses during the Page Translation phase.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Wow, got it to work! I read that article when the newsletter came out, but since I hadn't done any JSP stuff (and VERY little XML) at that time, I didn't quite get it. I was using IBM's tutorial on JSPs, and they didn't mention anything about the root and text tags.
Don't want to turn this into an XML dicussion, but do you know of some really good online tutorials using XML and JSP?
Thanks a million Carl
Jim Petersen
Ranch Hand

Joined: Jul 24, 2001
Posts: 241
Hi Jason
I'm not sure of what's available online, but I found
Professional JSP (2nd Ed The big red Wrox book - it is pretty up to date as well)
and Geary's Advanced JavaServer Pages good. Both are pretty cool in terms of readability and getting the code to run (probably the most important important point!)


- Jim Petersen <br />SCJP2<br />SCWCD<p>- but then again, I could be wrong...
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
I've got the Professional JSP on the way, should be here today or tomorrow, glad to know it will be worth the money. Personally, having a bit of a hard time with Professional Java Server Programming (J2EE Edition).
Thanks for the info!
Jim Petersen
Ranch Hand

Joined: Jul 24, 2001
Posts: 241
Hi Jason... err one more for the road!? (before the topic gets moved to either of the JSP/XML forums ) here is something online
I found this buried on Sun's site which may also help
http://java.sun.com/products/jsp/html/JSPXML.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting JSPs on Tomcat server to recognize XML