Announcement Announcement Module
Collapse
No announcement yet.
Keeping classpath relative in applicationContext-security.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 02:24 PM.

  • #2
    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>

    Comment

    Working...
    X