scwcd的考试,测试代码,如果希望参加此类考试将非常的有帮助

源代码在线查看: progexception3.java

软件大小: 132 K
上传用户: sy780415
关键词: scwcd 测试代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				package scwcd.lab05;
				
				import javax.servlet.*;
				import javax.servlet.http.*;
				import java.io.*;
				
				public class ProgException3 extends HttpServlet {
				  public void doGet(HttpServletRequest request,
				                    HttpServletResponse response)
				         throws IOException, ServletException {
				    String[] array1 = new String[3];
				   
				    try {
				      array1[4] = "some message...";
				    } catch (ArrayIndexOutOfBoundsException e) {
				      ServletContext context = getServletContext();
				      RequestDispatcher errorPage
				          = context.getNamedDispatcher("ProgExceptionHandler");
				      request.setAttribute("request_uri",
				                            request.getRequestURI());
				      request.setAttribute("thrown_exception",e);
				      errorPage.forward(request, response); 
				    }
				  }
				}			

相关资源