storeaction.java

来自「基于struts的一个异常处理框架,采用aop原理来统一处理异常。」· Java 代码 · 共 38 行

JAVA
38
字号
package org.expframework.samples.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.expframework.data.ExceptionDisplayDTO;

public class StoreAction extends BaseAppDispatchAction {
    public ActionForward execute(ActionMapping actionMapping,
            ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        return super.execute(actionMapping, actionForm, request, response);
    }

    public ActionForward searchStore(ActionMapping actionMapping,
            ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        //Create an instance of ExceptionDisplayDTO with ActionMapping name
        // which will be
        //used to forward the page for application exception. Another param is
        // the context for context
        //sensitive exceptions.
        ExceptionDisplayDTO expDTO = new ExceptionDisplayDTO("SearchStore",
                "storeAction.searchStore");
        expDisplayDetails.set(expDTO);

        //perform business processing
        //...
        //...

        //Forward to a page for successful conditions
        return actionMapping.findForward("SearchStore");

    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?