配置没错,不过不明白你super.doGet(request,response); 
这句是做什么?调用httpServlet的doGet,却啥也没做?
应该转到其它页面去吧,例如:  if(flag){ 
    System.out.println("aaaa請不要非法訪問"); 
  }else{ 
    //super.doGet(request,response); 
    response.sendRedirect("http://www.163.com");

解决方案 »

  1.   

    其實是我對httpServlet理解的偏失.
    我將HttpServlet.doGet()方法與HttpJspPage._jspService()方法給混淆啦.我最初的意圖就是這樣的:
    訪問的url                                                          結果
    http://localhost:8080/website/login.jsp                         得到login.jsp頁面
    http://localhost:8080/website/login.a                           aaaa請不要非法訪問我忘了HttpServlet.doGet()方法是什麼東西都沒有做.