Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spring.mvc.view.prefix=/WEB-INF/jsp/
- spring.mvc.view.suffix=.jsp
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.RequestMapping;
- @Controller
- public class HomeController {
- @RequestMapping("/")
- public String hello(Model theModel){
- Credentials theCredentials = new Credentials();
- theModel.addAttribute("credentials", theCredentials);
- return "homepage";
- }
- }
- public class Credentials {
- private String username;
- private String password;
- public Credentials() {
- }
- public String getUsername() {
- return username;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <html>
- <head>
- <title>Homepage</title>
- </head>
- <body>
- Welcome to the virtual deanery!!!
- <br><br>
- Please log in as Student or Teacher to continue:
- <br><br>
- <form:form modelAttribute="credentials">
- <%--credentials are not found--%>
- <%--somecode--%>
- </form:form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment