主题:为什么编译不了javaBean
请高手看一下这个 java 文件那里出错了,为什么编译不了javaBean?
急~~~~ [em17]
package classmate;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.*;
public class LoginAction extends HttpServlet
{
public LoginAction()
{
}
public void init(ServletConfig servletconfig)
throws ServletException
{
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
request.setCharacterEncoding("UTF-8");
String uname = request.getParameter("uname");
String psw = request.getParameter("psw");
response.setContentType("text/xml; charset=UTF-8");
response.setHeader("Cache-Control", "no-cache");
PrintWriter out = response.getWriter();
out.println("<response>");
DB db = new DB();
String strSql = null;
strSql = "select * from classuser where username='" + uname + "' and password='" + psw + "'";
ResultSet rs = db.executeQuery(strSql);
try
{
if (rs.next())
out.println("<res>热烈的欢迎您!</res>");
else
out.println("<res>对不起,登录失败!</res>");
}
catch (SQLException e)
{
e.printStackTrace();
}
out.println("</response>");
out.close();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
doGet(request, response);
}
}