Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. @RequestMapping("/login")
  2. public String login(@RequestParam(name = "newuserN1") String username, @RequestParam(name = "newpassW1") String password1, @RequestParam(name = "newpassW2") String password2) {
  3. if (password1.equals(password2)) {
  4. String kod = password1;
  5. loginService.createLogin(username, kod);
  6.  
  7. return "login";
  8. } else {
  9. ModelAndView modelAndView=new ModelAndView("newLogin");
  10. String answer="Password-lar uyusmur";
  11. modelAndView.addObject("answ", answer);
  12. return "newLogin";
  13. }
  14. }
  15. -----------------------------------------------------------------------
  16.  
  17. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  18. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  19. <html>
  20. <head>
  21. <title>New Login</title>
  22. </head>
  23. <body>
  24. <form action="/login">
  25. <h3>Username<input type="text" name="newuserN1"></h3>
  26. <br/>
  27. <h3>Password<input type="text" name="newpassW1"></h3>
  28. <h3>Password<input type="text" name="newpassW2"></h3>
  29. <input type="submit" name="creat" value="Creat">
  30. <table>
  31. <tr>
  32. <td>${answ}</td>
  33. </tr>
  34. </table>
  35.  
  36. </form>
  37.  
  38.  
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement