Hi,

I see the problem,

BaseTemplateEngine#getThemeProps(Template template) doesn't use
ServletContext to resolve possible paths where theme.properties can be
found.

The solution is easy - move theme.properties under classpath and the
reset can lay where it is right now. The second option is to modify
BaseTemplateEngine to use also ServletContext (or somehow tell
BaseTemplateEngine to use ServletContext)


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/12/12 rgm <str...@rgm.nu>:
> I'm trying to figure out why "theme.properties" isn't loaded from the
> filesystem on my JBoss 7 system and believe that this is a useful change to
> BaseTemplateEngine.java:
>
>     private InputStream createFileInputStream(File propFile) throws
> FileNotFoundException {
>         InputStream is = null;
>         if (propFile.exists()) {
>             is = new FileInputStream(propFile);
> +        } else {
> +          throw new FileNotFoundException(propFile.toString());
> +        }
>         return is;
>     }
>
> This change allows the following message to be seen from the calling method:
>   LOG.warn("Unable to find file in filesystem [" +
> propFile.getAbsolutePath() + "]");
>
> Without this change, no warning is printed (unless there's a problem
> creating the FileInputStream).
>
> Alternately, one could remove the check for "propFile.exists()" entirely
> and allow the constructor for FileInputStream to throw the exception itself.
>
> -rgm

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to