Alex Rivera | Logout

JAX-RS Application on the root context - how can it be done?

Asked 2012-06-03T21:47:40.220
41

I would like to have my JAX-RX Application start at the root context so my URLs will be

http://example.com/restfullPath

and not

http://example.com/rest/restfullPath

I switched my Application's annotation from this

@ApplicationPath("/rest/*")

to this

@ApplicationPath("/*")

But then it seems that it takes over serving files such as /index.html

Is there a way to run a JAX-RS on the root application context but still have static pages served?

Seems this was asked before on the JBOSS forum, but the solution is not really practical

Edit
Report

1 Answer

0

Quoting @damo for Jersey 2.0 from another post

"Alternatively, you might be able to pull something off with some kind of redirection. For example, with a Pre-matching Filter. I've never done anything like this, but the documentation suggests that "you can even modify request URI"."

answered 2013-06-26T22:02:00.670

Your Answer