APISonar


ninja.Results.xml

> ninja > Results > xml
ninja APIs Results APIs xml APIs

Example 1
public Result getArticlesXml() {

        ArticlesDto articlesDto = articleDao.getAllArticles();

        return Results.xml().render(articlesDto);

    }
Example 2
public Result postArticleXml(@LoggedInUser String username,
                                 ArticleDto articleDto) {

        boolean succeeded = articleDao.postArticle(username, articleDto);

        if (!succeeded) {
            return Results.notFound();
        } else {
            return Results.xml();
        }

    }