Announcement Announcement Module
No announcement yet.
PathMatchingResourcePatternResolver with /WEB-INF/i18n/*.properties cannot resolved Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:

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

    PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
    Resource[] resources = resolver.getResources(pattern);

    There is 1 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
    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

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

      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, 11:53 AM.