Example #1
0
 public void doTag() throws JspException {
   List<Product> products =
       (List<Product>) CatalogService.getInstance().getlabelProducts("recent");
   try {
     for (Product product : products) {
       ActionContext.getContext().getValueStack().push(product);
       getJspBody().invoke(null);
     }
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
  public void doTag() throws JspException, IOException {
    try {
      List<Category> categories = CatalogService.getInstance().getSubCategories(categoryID);
      for (Category category : categories) {
        ActionContext.getContext().getValueStack().set(alias, category);
        StringWriter sw = new StringWriter();
        getJspBody().invoke(sw);
        getJspContext().getOut().println(sw.toString());
      }

    } catch (Exception e) {

    }
  }