0

I was trying to follow the declarative linking example: http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22declarative-linking%22

Here is my code:

@InjectLink(   
        resource = FolderResource.class,  
        method = "query",   
        style = Style.ABSOLUTE,   
        bindings = {@Binding(name = "requestCount", value="99")   
        },   
        rel = "${rel}"  
)   
@XmlJavaTypeAdapter(Link.JaxbAdapter.class)
@XmlAttribute 
private Link href;

When I run it, i am getting this:

.....
       "href": "javax.ws.rs.core.Link$JaxbLink@41a741a7",
.....

instead of the actual link.

If I use a String type instead of Link and don't use @XmlJavaTypeAdapter(Link.JaxbAdapter.class), I am getting a correct link but without query parameters.

Advise, please.

Yuri P.
  • 389
  • 2
  • 11

1 Answers1

1

I have come across the same issue when trying to produce JSON output using MOXY. However, It works well when XML is set as Accept Header.

I wrote a MessageBodyWriter and MessageBodyRighter using Gson as the JSON provider. Unfortunately, this breaks the SelectableEntityFilteringFeature because this feature depends on MOXY.

Fazlan
  • 11
  • 1