Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-780

Improve Configuring Resource Loaders docs by mentioning difference for VVS

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6.4
    • 2.0
    • Documentation
    • None

    Description

      I spent whole day fighting with my first "hello world" VelocityViewServlet-based servlet. I was struggling with:
      org.apache.velocity.exception.ResourceNotFoundException

      For following dumb code:
      protected Template getTemplate(HttpServletRequest request, HttpServletResponse response) {
      return getTemplate("test.vm");
      }

      1) http://velocity.apache.org/engine/releases/velocity-1.6.4/developer-guide.html#Velocity_Configuration_Keys_and_Values
      claims following:
      resource.loader = <name> (default = file)

      As the result I was trying to use following configuration:
      file.resource.loader.path = WEB-INF/vmtemplates

      2) http://velocity.apache.org/engine/releases/velocity-1.6.4/developer-guide.html#Configuring%5FResource%5FLoaders
      doesn't mention "webapp" (which seems to be default btw)

      The correct solution for me was to change
      file.resource.loader.path = WEB-INF/vmtemplates
      to
      webapp.resource.loader.path = WEB-INF/vmtemplates

      I don't know Velocity enough yet, so can not really write correct docs. Would be great if someone could clear this part.

      Attachments

        Activity

          People

            cbrisson Claude Brisson
            zajec5 Rafał Miłecki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: