http://blog.jdriven.com/2016/02/urlrewritefilter-load-configuration-with-spring-resourceloader/
Urlrewrite.xml placed under Resources folder
@Configuration
public class Urlrewritefilterconfig extends urlrewritefilter{
private static final String Url_rewrite = "Classpath:/urlrewrite.xml";
Inject the Resource from the given location
@Value (Url_rewrite)
Private Resource Resource;
Override the Loadurlrewriter method, and write your own implementation
protected void Loadurlrewriter (Filterconfig filterconfig) throws Servletexception {
try {
Create a Urlrewrite Conf object with the injected resource
Conf Conf = new Conf (Filterconfig.getservletcontext (), Resource.getinputstream (), Resource.getfilename (), "@@[email protected]@ ");
checkconf (conf);
} catch (IOException ex) {
throw new Servletexception ("Unable to load URL rewrite configuration file from" + Url_rewrite, ex);
}
}
}
Configure the URL in Springboot rewrite