编译servlet时找不到符号

时间:2012-02-10 22:01:52

标签: java jsp servlets

这是我的servlet代码:

    package com.example.web;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.io.IOException;
    public class BeerSelect extends HttpServlet{
      public void doPost(HttpServletRequest request,
          HttpServletResponse response) 
          throws IOExcpetion, ServletException{
        response.setContentType("text/html");
        PrintWriter  out = response.getWriter();
        out.println("Beer Selection Advice<br />");
        String c = request.getParameter("color");
        out.println("Got beer color " + c);
      }
    }

当我编译它时,我收到以下错误:

  

找不到符号抛出IOExcpetion,ServletException

2 个答案:

答案 0 :(得分:3)

变化:

throws IOExcpetion

要:

throws IOException

答案 1 :(得分:2)

错字:IOExcpetion应为IOException