Results 1 to 2 of 2

Thread: Keeping classpath relative in applicationContext-security.xml

  1. #1

    Default Keeping classpath relative in applicationContext-security.xml

    Hi guys!

    Bit'o'problem, here's the code:

    Code:
        <beans:bean id="sesFactory"
          class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
            <beans:property name="configLocation">
                <beans:value>file:C:\Users\Dingles\Documents\NetBeansProjects\TestingClass\src\java\hibernate.cfg.xml</beans:value>
            </beans:property>
        </beans:bean>
    (applicationContext-security.xml is under WEB-INF)
    I want to make this file path relative, but I'm having no luck I keep it under /src/ currently 'cause hibernate configure won't take in a relative path for me either :/

    edit:fixed with classpath: relative file point
    Last edited by Spacekangaroo; Aug 12th, 2012 at 01:24 PM.

  2. #2
    Join Date
    Dec 2009
    Location
    India
    Posts
    108

    Default

    You may choose to specify the resource to be a classpath resource rather than a file system resource as in
    <code>
    <beans:bean id="sesFactory"
    class="org.springframework.orm.hibernate3.annotati on.AnnotationSessionFactoryBean">
    <beansroperty name="configLocation">
    <beans:value>classpath:hibernate.cfg.xml</beans:value>
    </beansroperty>
    </beans:bean>
    </code>

Posting Permissions

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