Announcement Announcement Module
No announcement yet.
Velocity and Webapp Resource Loader Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Velocity and Webapp Resource Loader

    Im going through the usual hassles of setting up Velocity with Spring MVC. I'm having a problem with resource loaders. I was first loading from classpath, but this is unwieldy during development.

    I managed to get the File resource loader. The problem is that it only allows one folder for everything (at least I can't make it take more). Pluss, right now I'm using Tomcat and the Sysdeo plug-in which probably keeps my war in some expanded state. When I start using a war, I guess the paths might break.

    What I found was the Webapp Resource Loader:

    It's supposed to make things easy, but it won't work. It was recommended by someone on this forum, so someone must have it working.

    This is my config:
    <bean id="velocityConfigurer"
    class="org.springframework.web.servlet.view.veloci ty.VelocityConfigurer">
    <property name="configLocation">


    <bean id="velocityViewResolver"
    class="org.springframework.web.servlet.view.veloci ty.VelocityViewResolver">
    <property name="prefix">
    <property name="suffix">
    <property name="exposeSpringMacroHelpers">
    <property name="dateToolAttribute">
    <property name="numberToolAttribute">

    And here it

    #webapp.loader.description=Loads resources from CLASSPATH
    webapp.resource.loader.class=org.apache.velocity.t ools.view.servlet.WebappLoader

    I guess the actual file structure in my web-project is obvious from the config.

    Thanks for any help.

  • #2
    Oh, the actual error message is:

    WebappLoader : unable to retrieve ServletContext