zoukankan      html  css  js  c++  java
  • 第四天

    第四天
    package com.lzw;
    import javax.servlet.http.HttpServletRequest;
    import javax..servlet.http.HttpServletResponse;
    import org.springframework.vlidation. BindExcpion;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc .SimpleFormController;
    public class LoginController extends SimpleFormController {
          protected ModelAndView onSubmit(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2,BindException arg3) throws Exception{
          //TODO自动生成方法存根
          return super.onSubmit(arg0, arg1, arg2, arg3);
    }
         protected ModelAndView showForm(HttpServletRequest arg0, HttpServletResponse arg1,BindException arg2) throws Exception{
    // TODO自动生成方法存根
          return super. showForm(arg0, arg1,arg2);

    }
    public LoginController(){
    setCommandClass(UserLoginForm.class);
    }
    protected ModelAndView onSubmit(HttpServletRequest request,
     HttpServletResponse response,Object command,BindException errors)
    throws Exception{
    HttpSession session= request.getSession();
    UserLoginForm form= (UserLoginForm) command;
    if(dao.getUser(form.getUsername(), form.getPassword())!=null){
          session.removeAttribute( "manager");
          session.setAttribute("username", form.getUsername());
    }
    return new ModelAndView(new RedirectView("index.lzw"));
    }
    Potcted ModelAndView showForm(HttpServletRequest request,HttpServletResponse response, BindExeption errors) throws Exception{
          HttpSession session-request.getSession();
          String loginOut=request.getParameter(“LoginOut”);
          if(loginOut!=null&&loginOut.equalsIgnoreCase(“ture”)){
           session.invalidate();
    }
         return new ModelAndView(new RedirectView("index.lzw"));
    }
    昨天:1.增加窗口的边框,颜色或者条纹;
          2.可以调整背景色彩图片;
          3.复习窗口装饰相关的Java语言编程;
    今天:1.编写相关代码;
    明天:1.编写相关代码;
  • 相关阅读:
    JAVA 正则表达式 (超详细)
    Windows命令-route
    Spring3 MVC请求参数获取的几种方法[转]
    Linux-支持中文
    Linux-Tmux使用初体验
    Linux命令-工作管理命令:&,ctrl+z,jobs,fg,bg
    Linux命令-服务管理命令:chkconfig
    Linux命令-文件系统常用命令:df,du,fsck,dumpe2fs
    Linux命令-用户管理:useradd,userdel,usermod,id,su,env,exit
    Linux命令-某个用户组下面的所有用户
  • 原文地址:https://www.cnblogs.com/sjztd-slx/p/9979452.html
Copyright © 2011-2022 走看看