예제 #1
0
  @Request.Get("/product/download_picture/{id}")
  public void downloadPicture(long id) {
    Product product = productService.getProduct(id);
    String picture = product.getPicture();

    String filePath = Tool.getBasePath() + picture;
    WebUtil.downloadFile(DataContext.getResponse(), filePath);
  }
예제 #2
0
  @Request.Get("/products")
  public View index() {
    int pageNumber = 1;
    int pageSize = Tool.getPageSize("product_pager");
    String name = "";

    Pager<ProductBean> productBeanPager =
        productService.getProductBeanPager(pageNumber, pageSize, name);
    return new View("product.jsp").data("productBeanPager", productBeanPager);
  }