Results 1 to 2 of 2

Thread: Placing schema's in seperate jar

  1. #1
    Join Date
    Jul 2007
    Posts
    8

    Default Placing schema's in seperate jar

    Is it possible to place the schemas for the service contracts in a separate jar, and if so how do you reference this location.

    I've tried just depending on this new schema jar but referencing the location using SimpleXsdSchema throws a ServletContext resource [/xsd/messages.xsd]' does not exit

    The schema bean is
    Code:
    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
       <property name="xsd" value="/xsd/messages.xsd" />
    </bean>
    And I've got xsd/messages in my schema jars resource directory (Using Maven)

    Thanks

  2. #2
    Join Date
    Mar 2007
    Posts
    15

    Default

    Yes it is possible. We are doing this in our project.

    Just reference the schemas with the standard springframework classpath prefix "classpath:", so in your case that would mean this:

    Code:
    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
       <property name="xsd" value="classpath:/xsd/messages.xsd" />
    </bean>
    See Spring doc here: http://static.springframework.org/sp...s-dependencies
    Last edited by Paul Nyheim; Jun 9th, 2008 at 05:36 AM. Reason: update with link to spring documentation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •