⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 indexaction.java

📁 地方划时代反函数的地方划时代反函数的地方划时代反函数的地方划时代反函数的
💻 JAVA
字号:
package Index.Action;

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 Index.Form.IndexActionForm;
import org.apache.struts.action.Action;
import Tool.DBA.GetConn;
import java.sql.Connection;

public class IndexAction
    extends Action {
  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest servletRequest,
                               HttpServletResponse servletResponse) {
    GetConn gc = new GetConn();
    Connection conn = gc.getConnection();





    IndexActionForm iaf = (IndexActionForm) actionForm;
    String username = "";
    String password = "";
    try {
      username = iaf.getUsername();
      password = iaf.getPassword();
      if (username.trim().equals(password)) {
        return actionMapping.findForward("main");
      }
      else {
        return actionMapping.findForward("error");
      }
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -