Results 1 to 2 of 2

Thread: Get Resources

  1. #1
    Join Date
    Aug 2004
    Location
    Argentina
    Posts
    14

    Default Get Resources

    I can obtain a XML bean factory independent of ApplicationContext? Example

    ApplicationContext def..

    beans>

    <!-- Definition if bean ReportFactory -->
    <bean id="reportFactory" class="tgn.util.tld.ReportFactory">
    <constructor-arg>
    <value>reports- spring.xml</value>
    </constructor-arg>
    </bean>


    </beans>

    my XML reports reports- spring.xml

    <beans>

    <!-- Definicion del bean StringParameters -->
    <bean id="stringParamBean" class="report.impl.StringParameter" singleton="false">
    <property name="name"><value>Motocompresor</value></property>
    <property name="id"><value>planta</value></property>
    <property name="value"><value>Algo que decir</value></property>
    <property name="required"><value>true</value></property>
    </bean>

    </bean>


    The file of reports is in the Web-inf directory, but the objective is to load this xml when it is needed not like part of the context

    My Class ReportFactory

    ....
    public ReportFactory(String path){
    this.path = path;
    ClassPathResource res = new ClassPathResource(path);

    factory=new XmlBeanFactory(res);
    }
    ...
    }


    But when loading the application I obtain one exception, of file nonfound in class path

    It is possible to do this?

    Thankz Javier

  2. #2

    Default

    Hi,
    you have to move your reports file to the WEB-INF/classes dirctory in your webapp.
    Or you just use FileSystemResource with the full path (or relative from TOMCAT_HOME/bin)

    regards,
    Mario

Similar Threads

  1. Replies: 3
    Last Post: Oct 31st, 2005, 03:23 AM
  2. Multiple Resources Transaction Question
    By davidcnoel in forum Data
    Replies: 3
    Last Post: May 3rd, 2005, 08:39 AM
  3. FactoryBean for configuring Resources.
    By rcui in forum Container
    Replies: 0
    Last Post: Apr 17th, 2005, 09:55 PM
  4. Protecting Web resources using a custom voter
    By dhainlin in forum Security
    Replies: 3
    Last Post: Jan 24th, 2005, 05:24 AM
  5. Access resources in WEB-INF
    By dev001 in forum Web
    Replies: 10
    Last Post: Nov 22nd, 2004, 03:00 AM

Posting Permissions

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