运行的时候都是用jsp运行的.没法加断点呀package login;import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;
import java.sql.*;public class LoginAction
    extends Action {
  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest servletRequest,
                               HttpServletResponse servletResponse) {
    LoginActionForm loginActionForm = (LoginActionForm) actionForm;
    String password="";
    try{
      Class.forName("org.gjt.mm.mysql.Driver");
      Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/login","root","admin");
      Statement stmt = conn.createStatement() ;
      String sql="select password from user where username='"+loginActionForm.getUsername()+"'";
      ResultSet rs=stmt.executeQuery(sql) ;
      while(rs.next() )
      {
        password = rs.getString("password") ;
      }
      rs.close() ;
      stmt.close() ;
      conn.close() ;
    }catch(Exception e)
    {
      e.printStackTrace() ;
    }    if(password.equals(loginActionForm.getPassword() ))
    {
      return (actionMapping.findForward("loginsuccess") );
    }
    else
    {
      return (actionMapping.findForward("loginfail") );
    }
  }
}