Beanable Interface Deprecation


We are looking into replacing deprecated code, etc. The Beanable interface is one such item. Can anyone point me to a document or an explanation of what I need to do to replace it please?


The javadoc states: @Deprecated since 5.2. If you want a JSON-producing REST endpoint, then use a proper JAXRS resource.

This is documented here:

Thank you very much.

1 Like

I have read this but I need more concrete information, like:
We import the Beanable Interface like so:
import com.atlassian.confluence.core.Beanable;
Do I need to import something else instead?

We implement Beanable like so:

public class PageStatusActionImpl extends ConfluenceActionSupport 
   implements PageAware, PageStatusAction, Beanable {

Do I need to implement something else instead? If so, what?

We override getBean like so:

public Object getBean() 
{	return resultBean; }

Do I need to replace this? If so, with what?

We catch the result from getBean like so:

Map<String, Object> resultBean = new HashMap<String, Object>(); // for json result types
resultBean.put(LABELRESULT, currentLabel);

Do I need to change this?

If Beanable is deprecated there must be somebody at Atlassian that has removed the code that uses Beanable from the Confluence code. Can they respond to this or be contacted?

This is the developer community forum. If you have support for Atlassian products, then input a support request.

I don’t know if i can explain how JAX-RS works in a comment. It’s not difficult, but it’s not simple either.

Thank you very much for your reply.

I have an example, but I am not sure how to apply it to your example. A serializable object is annotated like this –

import org.codehaus.jackson.annotate.JsonProperty;

public class PostDTO {
    private Long id;
    private String title;
    private String body;

    public PostDTO() {

    public PostDTO(final Long id, final String title, final String body) { = id;
        this.title = title;
        this.body = body;

    public Long getId() {
        return id;

    public String getTitle() {
        return title;

    public String getBody() {
        return body;

Then a class has methods annotated with methods and path options –

import com.atlassian.pocketknife.api.querydsl.DatabaseAccessor;
import com.atlassian.pocketknife.api.querydsl.util.OnRollback;

import javax.inject.Inject;
import javax.inject.Named;

import static;
import static;
import static;

public class PostService {
    private final DatabaseAccessor databaseAccessor;
    private final PostDAO posts;

    public PostService(final DatabaseAccessor databaseAccessor, final PostDAO posts) {
        this.databaseAccessor = databaseAccessor;
        this.posts = posts;

    public Response create(PostDTO draft) {
        return Response.status(CREATED)
                .entity(databaseAccessor.runInNewTransaction(connection -> posts.create(draft, connection), OnRollback.NOOP))

    public Response getAll() {
        return Response.status(OK)
                .entity(, OnRollback.NOOP))

Great stuff! Thank you. This gives me something to start with. :smiley:

Do you know of a package that has been upgraded from using Beanable? Then I can see what changed between the old and new versions.

I found a web page that recommends using /rest/quicknav/1/search instead but then I read one that said that “We ended support for this gadget in Confluence 7.0”. So the next question is: What do we use instead of QuickNav?