0

Im trying to keep constant all the urls of my aplication storing it in a .properties file. For example:

//url.properties
url.prefix.module_users=/users

So, in case that I want to change an url, dont have to look for all the places where I use it. I use this in my spring-security.xml, controllers. I wonder if in my decorators.xml file I can use it as well:

<?xml version="1.0" encoding="UTF-8"?>
<decorators defaultdir="/decorators">
        <decorator name="layout-login" page="layout-login.jsp">
        <pattern>/</pattern>
    </decorator>
    <decorator name="layout-base" page="layout-base.jsp">
         <pattern>${url.prefix.module_users}/*</pattern>
    </decorator>
</decorators>

Is this possible?

kiduxa
  • 3,339
  • 11
  • 37
  • 52
  • The decorator file is not loaded by Spring, it is loaded by the sitemesh `Filter` implementation. As such you can't externalize your properties and expect them to be loaded by Spring. – Sotirios Delimanolis Sep 12 '13 at 21:20
  • And in the configuration of the filter, there is nothing that can be done? – kiduxa Sep 12 '13 at 23:36
  • I can't find the source code and the docs don't say much. – Sotirios Delimanolis Sep 12 '13 at 23:41
  • As usually documentation is not always complete.. lets see if anyone else nows something about it.. – kiduxa Sep 12 '13 at 23:46
  • Turns out source code is available right [here](https://github.com/sitemesh/sitemesh3). You can look for how the properties are loaded and possibly create a hook into that. Consider using `WebApplicationInitializer` to setup the `Filter`. – Sotirios Delimanolis Sep 13 '13 at 03:05

0 Answers0