81,092
社区成员
发帖
与我相关
我的任务
分享
@RequestMapping("/test")
public String uploadFile(@RequestParam("file") MultipartFile file) throws IllegalStateException, IOException
{
if(!file.isEmpty())
{
file.transferTo(new File("d:"+file.getOriginalFilename()));
System.out.println("涓婁紶鏂囦欢");
}
return "home";
}
<body>
<form action="verification.do">
UserName : <input name="username" id="username" type="text"/>
PassWord : <input name="password" id="password" type="password"/>
<button name="login">login</button><br/><br/>
</form>
</body>
java代码:
@RequestMapping("test/verification.do")
public ModelAndView login(String username, String password){
UserEntity user = userService.userLogin(username, password);
Map<String,Object> map = new HashMap<String, Object>();
String result = "";
if(user==null) {
result = "loginError";
}
else {
result = "loginSuccess";
map.put("userInfo", user);
}
System.out.println(map.get("userInfo").getClass());
UserEntity userssss = (UserEntity)map.get("userInfo");
System.out.println(userssss.getPassword());
return new ModelAndView(result,map);
}