Java Concurrency in Practice:无法解析符号" servlet"

时间:2015-10-18 03:21:12

标签: java servlets

代码示例:

public class CountingFactorizer implements Servlet {
    private BigInteger lastNumber;
    private BigInteger[] lastFactors;

    public synchronized void service(ServletRequest req, ServletResponse resp) {
        BigInteger i = extractFromRequest(req);
        if (i.equals(lastNumber))
            encodeIntoResponse(resp, lastFactors);
        else {
            BigInteger[] factors = factor(i);
            lastNumber = i;
            lastFactors = factors;
            encodeIntoResponse(resp, factors);
        }

    }
}

它说无法解析符号" servlet"

我下载了servlet.jar并将其导入IDE,但是 extractFromRequest encodeIntoResponse 方法仍然无法解析。

请告诉我如何解决它。

我的Java Enrivonment: Java SE8

0 个答案:

没有答案