ModelView로 넘긴 데이터 jsp 오류
-
아래 오류가 발생합니다
Wed Jul 01 14:19:58 UTC 2020
There was an unexpected error (type=Internal Server Error, status=500).
org.apache.jsp.WEB_002dINF.views.boardList_jspjava 파일
@RequestMapping(value = "/boardList") public ModelAndView boardList(Model model){ List<TodoResult> list = todoService.getTodoList(); model.addAttribute("list",list); return new ModelAndView("boardList","list",list); }
jsp파일
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>글목록<title> </head> <body> <div id="wrap" align="center"> <h1> 게시글 리스트 </h1> <table class="list"> <tr> <th>번호<th> <th>제목<th> <th>작성자<th> <th>작성일<th> </tr> <c:forEach var="row" items="${list}"> <tr class="recod"> <td>${row.game_no}</td> <td>${row.game_name}</td> <td>${row.write_usr}</td> <td>${row.write_date}</td> </tr> </c:forEach> </table> </div> </body> </html>
build.gradle 파일
group 'io.goorm' version '0.0.1' apply plugin: 'java' sourceCompatibility = 1.8 buildscript{ //전역변수 선언 ext{ springBootVersion = '2.1.7.RELEASE' } repositories{ maven{ url "https://plugins.gradle.org/m2/" } mavenCentral() jcenter() } dependencies{ classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" } } apply plugin: 'java' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' sourceCompatibility = 1.8 targetCompatibility = 1.8 repositories { jcenter() mavenCentral() } dependencies { compile 'org.springframework.boot:spring-boot-starter' compile 'org.springframework.boot:spring-boot-starter-web' compile 'org.springframework.boot:spring-boot-starter-hateoas' compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.5.0' compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.5.0' testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile group: 'junit', name: 'junit', version: '4.12' // 데이터베이스연동 compile 'org.slf4j:slf4j-api:1.7.7' compile group: 'org.hsqldb', name:'hsqldb', version:'2.3.2' compile "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}" compile group: 'org.hibernate', name:'hibernate-validator', version:'5.1.3.Final' compile 'mysql:mysql-connector-java' //웹기반 디바이스에서 데이터 연동 compile group: 'javax.el', name:'javax.el-api',version:'3.0.0' compile group: 'javax.validation',name:'validation-api',version:'1.1.0.Final' compile 'javax.servlet:jstl' compile 'org.apache.tomcat.embed:tomcat-embed-jasper' compile group:'org.glassfish.web',name:'el-impl',version:'2.2' compile 'javax.inject:javax.inject:1' compile "com.google.dagger:dagger:2.8" annotationProcessor "com.google.dagger:dagger-compiler:2.8" } def webappDir = '$rootDir/src/main/webapp' jar { manifest { attributes 'Main-Class': 'project.Main' } }