resthub / springmvc-router

Adds route mapping capacity to any "Spring MVC based" webapp. Uses playframework.org Router implementation.
http://resthub.github.com/springmvc-router/
Other
167 stars 63 forks source link

Using a different method to get the absolute path. #69

Open raafaar opened 8 years ago

raafaar commented 8 years ago

The method in this change uses an InputStream instead of a File object.

The use of a method that doesn't depends of a File object, makes possible a deploy into a WebLogic because with WebLogic the configuration files are loaded from a generated jar instead of a file in the filesystem.

The motivation for this change is in this issue: https://github.com/resthub/springmvc-router/issues/68

I've tested myself this change with a simple spring boot project, using «gradle bootRun», delploying into a Tomcat server and into a WebLogic server. The three cases worked as expected.

kawas44 commented 7 years ago

+1 fix a problem when using SpringBoot and starting the application as an executable Jar.

Original error without this fix was: java.io.FileNotFoundException: class path resource [myroutes.conf] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/home/kawas/code/spring/webapp/target/webapp-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/myroutes.conf

Could you please review this PR ?