1 19 20 package za.org.coefficient.modules.error; 21 22 import za.org.coefficient.interfaces.CoefficientContext; 23 import za.org.coefficient.modules.BaseModule; 24 import za.org.coefficient.util.ejb.VelocityScreenUtil; 25 26 import java.util.HashMap ; 27 28 42 public class Error extends BaseModule { 43 45 public String getMainMethod() { 46 return "view"; 47 } 48 49 public String getModuleDescription() { 50 return "Module that is used to display simple error messages from a forward."; 51 } 52 53 public String getModuleDisplayName() { 54 return "Error"; 55 } 56 57 public CoefficientContext view(CoefficientContext ctx) throws Exception { 58 HashMap map = new HashMap (); 59 String errorMsg = ctx.getParameter("errorMsg"); 60 map.put("errorMsg", errorMsg); 61 StringBuffer sb = 62 VelocityScreenUtil.getProcessedScreen("error.vm", map); 63 64 ctx.setModuleContent(sb.toString(), getModuleDisplayName()); 66 return ctx; 67 } 68 } 69 | Popular Tags |