Results 1 to 3 of 3

Thread: PathMatchingResourcePatternResolver with /WEB-INF/i18n/*.properties cannot resolved

  1. #1
    Join Date
    May 2005
    Location
    BEEK, The Netherlands
    Posts
    231

    Default PathMatchingResourcePatternResolver with /WEB-INF/i18n/*.properties cannot resolved

    I'm using the jsp code below to find the resources in a certain directory within WEVB-INF:

    <code>
    <% String pattern = "/WEB-INF/i18n/*.properties";

    PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
    Resource[] resources = resolver.getResources(pattern);
    %>
    </code>

    There is 1 messages.properties file in the i18n directory and Spring is setup correctly using the ContextLoaderListener.

    When executing the jsp I get:
    class path resource [WEB-INF/i18n/] cannot be resolved to URL because it does not exist

    I also tried "**/WEB-INF/i18n/*.properties", this gives no error, but no resources are returned.

    Should it be possible what I'm trying to do?

    I'm using Tomcat 5.5.16

  2. #2
    Join Date
    May 2005
    Location
    BEEK, The Netherlands
    Posts
    231

    Default

    I also used a simple Main program to test the PathMatchingResourcePatternResolver without Tomcat and then it works.

    It seems related to Tomcat, are there any known problems with PathMatchingResourcePatternResolver in Tomcat?

  3. #3
    Join Date
    May 2005
    Location
    BEEK, The Netherlands
    Posts
    231

    Default

    Also

    WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContex t(this.getServletContext());
    ctx.getResources(pattern);

    finds the resources.

    However I don't have the xtc object, that's why I I'm using PathMatchingResourcePatternResolver().

    I need a container independent solution.
    Last edited by marceloverdijk; Feb 9th, 2007 at 10:53 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
  •