3 回答
TA贡献1796条经验 获得超7个赞
我的建议:
第一:查看你的myServlet.LoginValidate有没有实现Servlet接口
第二: 点击Project-->clean , 然后选中你的项目进行清理一次看看
TA贡献1818条经验 获得超11个赞
package myServlet;
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 LoginValidate extends HttpServlet{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
String name = request.getParameter("username");
String pwd = request.getParameter("password");
LoginDBO loginDBO = new LoginDBO();
String message = loginDBO.login(name,pwd);
String url = "returnMessage.jsp?message="+message;
url = new String(url.getBytes("GBK"),"ISO8859_1");
response.sendRedirect(url);
}
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
this.doGet(request, response) ;
}
}
这个是类的代码,里面包含了对包的定义了的。
添加回答
举报