0

I have a Tomcat server running Spring 4.1.6.

Spring exposes a REST API which is consumed by an AngularJS frontend.

Now I tried serving the frontend (.html, .js, .css, .jpg) with Spring Web MVC. Apparently this is pretty easy in Spring boot by placing the content in dedicated directories (How to deploy AngularJS app and Spring Restful API service on the same domain/server?).

But how do I do the same on Spring Web MVC? I've tried different things but so far only received a lot of 404s when I tried to access the content.

1 Answer 1

1

You just need to configure your application context with

<mvc:resources mapping="/resources/**" location="/resources/" />

and then put the files in WEB-INF/resources/ folder

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.