NagyI
NagyI

Reputation: 5997

Spring MVC transparent resource proxy

I'm looking for a solution which allows me to proxy specific requests from my Spring MVC webapp to an another HTTP server while running in development profile. What i'm trying to achieve is to make Dart's Pub serve the web application files on it's own HTTP port, but map this path into my Spring MVC application so the Spring provided REST resources and the Dart files will be served from the Spring MVC HTTP server from the browser's perspective of view. In a release configuration these files will be bundled into the war so the proxy will be not required.

I wonder if this is supported by any built in MVC element in Spring (eg. the mvc:resource) or i have to write my own proxy element for this?

Upvotes: 4

Views: 7755

Answers (1)

NagyI
NagyI

Reputation: 5997

It can be done using a special Controller which's bean can be assigned to a profile and included in the dispatcher context scope only in development time.

Upvotes: 1

Related Questions