FileDocCategorySizeDatePackage
TestAction.javaAPI DocExample1302Sun Aug 15 12:59:20 BST 2004com.oreilly.strutsckbk.ch09

TestAction

public class TestAction extends org.apache.struts.action.Action

Fields Summary
Constructors Summary
Methods Summary
public org.apache.struts.action.ActionForwardexecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

        
        String foo = null;
        foo.toString();

        int errorCode = Integer.parseInt(request.getParameter("errorCode"));
        switch (errorCode) {
        case -1:
            throw new ErrorCodeException(errorCode, new Object[] {"6474-8484","wangdoodle"});
        case 100:
            throw new ErrorCodeException(errorCode, new Object[] {"gburdell"});
        case 110:
            throw new ErrorCodeException(errorCode, new Object[] {new Integer(75)});
        default:
            throw new ErrorCodeException(-99, new Object[]{}, "unknown error code");
        }