servlet提交表单,编译失败
代码如下:
import
javax.servlet.ServletException;
import javax.servlet.http.*;
import java.io.*;
public class Login extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp){
try{
resp.setContentType("text/html;charset=gbk");
PrintWriter pw=resp.getWriter();
pw.println("<html>");
pw.println("<body>");
pw.println("<h1>用户登录</h1>");
pw.pritnln("<form action=LoginCl method=post>");
pw.println("用户名:<input type=text name=username><br/>");
pw.println("密码:<input type=password name=passwd><br/>");
pw.println("<input type=submit value=loing><br/>");
pw.pritnln("</form>");
pw.println("</body>");
pw.println("</html>");
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
public void doPost(HttpServletRequest req, HttpServletResponse resp){
this.doGet(req, resp);
}
}
报错行数:
pw.pritnln("<form action=LoginCl method=post>");
pw.pritnln("</form>");
错误提示:
The method pritnln(String) is undefined for the type PrintWriter
谢谢
------解决方案--------------------pritnln(String)不是PrintWriter的方法
------解决方案--------------------你拼写错了,正确的是println(String)
------解决方案--------------------
++
这些代码可以用提示功能的 再者 搂着这样的拼写错误可以编译么