Announcement Announcement Module
Collapse
No announcement yet.
PathMatchingResourcePatternResolver with /WEB-INF/i18n/*.properties cannot resolved Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:

    <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
    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?

    Comment


    • #3
      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, 10:53 AM.

      Comment

      Working...
      X