?? globalexceptionhandler.java
字號:
/*
* Created on Aug 9, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.nscorp.struts_class.handler;
import org.apache.struts.action.ExceptionHandler;
import org.apache.struts.action.*;
import org.apache.struts.config.*;
import javax.servlet.http.*;
import javax.servlet.*;
import com.nscorp.struts_class.form.*;
import org.apache.struts.*;
/**
* @author pk47r
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class GlobalExceptionHandler extends ExceptionHandler {
public ActionForward execute(java.lang.Exception ex,
ExceptionConfig ae,
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
{
ErrorFormBean efB = new ErrorFormBean();
efB.setMessage(ex.toString());
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("REALLY.BIG.BOO.BOO"));
// saveErrors(request,errors);
HttpSession sC = request.getSession();
request.setAttribute(Globals.ERROR_KEY, errors);
sC.setAttribute("errorBean", efB);
return (mapping.findForward("Error"));
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -