This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting JSPs on Tomcat server to recognize XML

 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 241
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!)
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 241
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic