resthub / springmvc-router

Adds route mapping capacity to any "Spring MVC based" webapp. Uses playframework.org Router implementation.

Home Page:http://resthub.github.com/springmvc-router/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not able to route static files or assets

varmasaurav opened this issue · comments

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.

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.