The field HttpServlet.lStrings is not visible
最近刚刚开始学习java web 在如下代码的时候提示出了这个错误,我ctrl+shift+o也木有用!代码是书上抄的。求各位java同学解释下。
package chapter4;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MethodTest extends HttpServlet {
@Override
protected void service(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException
{
String method = req.getMethod();
PrintWriter out=resp.getWriter();
//out.println(method);
if(method.equals("GET"))
{
doGet(req,resp);
}
else if(method.equals("POST"))
{
doPost(req,resp);
}
else
{
String errMsg=lStrings.getString("http.method_not_implemented");
}
}
}
拉格朗余项
9 years, 6 months ago