Package resources

Source Code of resources.RootResource

package resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

import views.ArticlesView;

import daos.ArticleDao;

@Path("/")
public class RootResource {

    private ArticleDao articleDao;

    public RootResource(ArticleDao articleDao) {
        this.articleDao = articleDao;
    }

    @GET
    public ArticlesView show() {
        return new ArticlesView(articleDao.findNewestArticles(5));
    }
}
TOP

Related Classes of resources.RootResource

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.