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

Not able to route static files or assets #67

Open varmasaurav opened 9 years ago

varmasaurav commented 9 years ago

I have put a static schema file (.xsd) in the location "src/main/webapp/resources/schemas/latest/" in my spring mvc project. But I am not able to understand how to specify static file routing in routes.conf. I looked at the play framework documentation which says below -

GET /home staticFile:/public/html/index.html

I tried possibilities like

GET /schema staticFile:/resources/schemas/latest/myXsd.xsd

and

GET /schema staticFile:/schemas/latest/myXsd.xsd

But nothing worked.

arashzz commented 7 years ago

I know this is pretty old and my answer might be pretty late but here is what you have to do to fix this issue. You just have to change staticFile into classpath Assuming your index.html is in :

src/main/resources/static

then you have to change the route.conf like this:

GET /home classpath:/static/index.html

my assumption is that staticFile is a scala's play framework standard not spring.