wood burning stoves 2.0*
The moose likes Tomcat and the fly likes WebContent on classpath? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "WebContent on classpath?" Watch "WebContent on classpath?" New topic
Author

WebContent on classpath?

Bob Peterson
Ranch Hand

Joined: Jul 30, 2004
Posts: 47
I'm trying to do simple XML validation against a Schema (ha! nothing is ever that simple). In past projects, we have located the /xsd directory under the /WebContent directory of a web project. In these past projects we had to use WSAD and WAS. On a new project we're trying to use lighter tools and use Eclipse/Tomcat 4.1. Tomcat for development, although it is deployed on WAS, but I've already digressed enough.

On WAS, we were able to load the XSD with the following code



and this worked just fine. However, in Tomcat, the url in the code above is coming back as null. So is the /WebContent directory not on the classpath in Tomcat, but it is in WAS?
[ December 27, 2006: Message edited by: B Preston ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Where is your xsd directory?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bob Peterson
Ranch Hand

Joined: Jul 30, 2004
Posts: 47
The /xsd directory is directly under the /WebContent directory. So a snippet of the directory structure is




[BSouther: Added UBB CODE tags so the directory structure would make sense]
[ December 28, 2006: Message edited by: Ben Souther ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Not sure how WAS builds its classpath.
In Tomcat, I have always needed to put resources under the WEB-INF/classes directory if I wanted them picked up from the classpath.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: WebContent on classpath?
 
Similar Threads
Cannot find the declaration of element 'tns:MetricConfiguration'
Validating XML with a XSD
xml validation agains xsd
javax.xml.validation doubt!
validate schema in DOM