Guest User

Untitled

a guest
Dec 11th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. spring.mvc.view.prefix=/WEB-INF/jsp/
  2. spring.mvc.view.suffix=.jsp
  3.  
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.ui.Model;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7.  
  8. @Controller
  9. public class HomeController {
  10.  
  11. @RequestMapping("/")
  12. public String hello(Model theModel){
  13.  
  14. Credentials theCredentials = new Credentials();
  15.  
  16. theModel.addAttribute("credentials", theCredentials);
  17.  
  18. return "homepage";
  19. }
  20. }
  21.  
  22. public class Credentials {
  23.  
  24. private String username;
  25. private String password;
  26.  
  27. public Credentials() {
  28. }
  29.  
  30. public String getUsername() {
  31. return username;
  32. }
  33.  
  34. public void setUsername(String username) {
  35. this.username = username;
  36. }
  37.  
  38. public String getPassword() {
  39. return password;
  40. }
  41.  
  42. public void setPassword(String password) {
  43. this.password = password;
  44. }
  45.  
  46. <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
  47. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  48. <html>
  49. <head>
  50. <title>Homepage</title>
  51. </head>
  52. <body>
  53.  
  54. Welcome to the virtual deanery!!!
  55. <br><br>
  56.  
  57. Please log in as Student or Teacher to continue:
  58. <br><br>
  59.  
  60. <form:form modelAttribute="credentials">
  61. <%--credentials are not found--%>
  62.  
  63. <%--somecode--%>
  64.  
  65. </form:form>
  66.  
  67.  
  68.  
  69. </body>
  70. </html>
Add Comment
Please, Sign In to add comment