OK,
I think I got something going.

@Path("/")
    public ServiceInterface getService(@HeaderParam(HttpHeaders.ACCEPT)
String header) {
        ServiceInterface result;
        switch (header) {
            case MediaTypes.V2_JSON:
                result = new ServiceV2();
                break;
            case MediaTypes.V2_XML:
                result = new ServiceV2();
                break;
            default:
                result = new ServiceV1();
                break;
        }
        return result;
    }

Then I can extend the base ServiceInterface in later versions....
So I think It'll work until 2.0.0 is in place :-)

br





--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/jax-rs-accept-header-versioning-tp4674121p4674138.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to