gpt4 book ai didi

java - 编译servlet时找不到该符号

转载 作者:行者123 更新时间:2023-12-01 17:32:58 28 4
gpt4 key购买 nike

这是我的 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);
}
}

当我编译它时,出现以下错误:

can not find symbol throws throws IOExcpetion, ServletException

最佳答案

更改:

throws IOExcpetion

致:

throws IOException

关于java - 编译servlet时找不到该符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9235422/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com