1 package hudson.model; 2 3 import org.kohsuke.stapler.StaplerRequest; 4 import org.kohsuke.stapler.StaplerResponse; 5 6 import javax.servlet.ServletException ; 7 import java.io.IOException ; 8 9 14 public abstract class AbstractModelObject implements ModelObject { 15 18 protected final void sendError(Exception e, StaplerRequest req, StaplerResponse rsp) throws ServletException , IOException { 19 sendError(e.getMessage(),req,rsp); 20 } 21 22 protected final void sendError(String message, StaplerRequest req, StaplerResponse rsp) throws ServletException , IOException { 23 req.setAttribute("message",message); 24 rsp.forward(this,"error",req); 25 } 26 } 27 | Popular Tags |