首页>代码>spring+spring mvc+mybatis+jsp实现简单学生信息管理系统>/StudentDemo/src/com/ms/ssm/controller/LoginController.java
package com.ms.ssm.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
import com.ms.ssm.pojo.User;
import com.ms.ssm.service.UserService;
@Controller
public class LoginController {
@Autowired
private UserService userServiceImpl;
@RequestMapping("login")
public String LoginController(HttpServletRequest request, HttpServletResponse reponse,
User user,Model model) throws Exception{
user.setUsername(request.getParameter("username"));
user.setPassword(request.getParameter("password"));
User aaa=userServiceImpl.CheckLogin(user);
if(aaa!=null){
model.addAttribute("username", user.getUsername());
return "Loginsuccess";
}else{
return "Loginfail";
}
}
}
最近下载更多
甜心冰淇淋 LV4
6月21日
xiaoaitx LV8
2024年11月22日
hongdongdong LV14
2024年6月18日
xiaolu-123 LV1
2024年4月9日
wwwww816 LV5
2023年12月19日
李亮 LV19
2023年8月29日
磊少不在 LV2
2023年6月18日
tmf852 LV5
2023年6月18日
2819271872 LV1
2023年6月16日
1257592068 LV6
2023年6月13日

最近浏览