users@jersey.java.net

Re: namespace prefix mapping

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 09 Oct 2007 10:10:45 -0400

On Oct 7, 2007, at 7:48 AM, A S Manzoor wrote:
>
> Is there anyway I can set the properties on the jaxb marshaller? I
> am using Jaxb to in and out XML representations and it would be
> nice to have readable namespace prefixes instead of ns1 and so on.
> Jersey is so good, I have no clue how its converting to and from
> XML (and i mean that as a compliment). It would be nice to get my
> hand on the marshaller to set the namespace prefix mapper. Thanks
> for your help.
>
There's currently no simple way to accomplish what you want. We have
discussed a few ideas related to application supplied JAXB contexts
but haven't decided on an approach yet.

For now you could create your own custom JAXB entity provider and
bundle that with your application. Paul's blog entry[1] provides lots
of detail on how to do that and you could base your new entity
provider on the existing JAXB one:
com.sun.ws.rest.impl.provider.entity.JAXBElementProvider.

Hope that helps.
Marc.

[1] http://blogs.sun.com/sandoz/entry/plugable_types_with_jax_rs

> Cheers
> su./hail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.