@Action( value = "save-material-ajax", results = { @Result( name = "success", location = "/WEB-INF/content/ajax-material/material-add-ajax.jsp"), @Result(name = "input", location = "/WEB-INF/content/ajax-material/material-add-ajax.jsp") }) public String save() throws Exception { try { if (materail != null && materailHash != materail.hashCode()) { if (materail.getPrefix().equals("") || materail.getPrefix().length() != 2) { addFieldError("prefix", Messages.getString("material.empty")); return INPUT; } if (materailService.hasCunjaction(materail.getId(), materail.getPrefix())) { addFieldError("prefix", Messages.getString("material.cunj")); return INPUT; } materailService.saveOrUpdate(materail); materailService.log(materail, "saveOrUpadate"); request.setAttribute("materialSuccess", SUCCESS); return SUCCESS; } } catch (Exception e) { addFieldError("prefix", Messages.getString("material.cunj")); } return INPUT; }
@Action( value = "materials", results = {@Result(name = "success", type = "tiles", location = "/material-list.tiles")}) public String list() throws Exception { this.setListOfMaterials(materailService.findAll()); return SUCCESS; }
@Action( value = "material-list-ajax", results = { @Result( name = "success", location = "/WEB-INF/content/ajax-material/material-list-ajax.jsp") }) public String list1() { this.setListOfMaterials(materailService.findAll()); return SUCCESS; }
public void prepare() throws Exception { if (materail != null && materail.getId() != null) { this.materail = materailService.get(materail.getId()); this.materailHash = materail.hashCode(); } }