-
Feb 8th, 2007, 03:58 PM
#1
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
-
Feb 9th, 2007, 12:43 AM
#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?
-
Feb 9th, 2007, 10:50 AM
#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 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
-
Forum Rules