NRaf
NRaf

Reputation: 7559

Multiple base paths in Jersey REST?

The web application I'm working is currently using REST to expose functionality to a iPhone application.

All iPhone REST URLs are in the format /mobile/*.

We're now looking to provide a RESTful API for public use. These addresses will be a format like /rest/*.

The issue is we need these new /rest/* addresses to work alongside the current /mobile/* (which can't be changed due to backwards compatibility issues).

I'm having trouble seeing how this can be done, though. Any ideas?

Upvotes: 2

Views: 1156

Answers (1)

Martin Matula
Martin Matula

Reputation: 7989

Just configure 2 servlets in your web.xml - one with /rest/* mapping and the other one with /mobile/* mapping. You can include the same resources in both.

Upvotes: 3

Related Questions