스프링 MVC

준비중..

스프링 MVC

스프링을 사용한 웹서비스 만들기

19 도서 검색

# 도서 검색 --- ## 검색창 만들기 도서 검색창을 만들어 줍니다. **views/books/index.jsp** ``` <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://www.springframework.org/security/tags" prefix="s"%> <%@ page pageEncoding="utf-8" session="false"%> <div class="jumbotron"> <h1>Books INDEX</h1> <p>views/books/index.jsp</p> <s:authorize access="hasRole('ADMIN')"> <a href="<c:url value="/books/new" />" class="btn btn-lg btn-primary">도서등록</a> </s:authorize> </div> <div class="container"> <!-- 검색 --> <div class="search"> <form class=""> <div class="row"> <div class="col-10"> <input type="text" class="form-control input-lg" placeholder="도서명으로 검색"> </div> <div class="col-md-2"> <button type="submit" class="form-control input-lg btn btn-primary"> <i class="fas fa-search"></i> </button> </div> </div> </form> </div> <!-- 도서 --> <div class="row"> <c:forEach var="book" items="${books}" varStatus="status"> <div class="col-md-4"> <div class="card"> <img src="<c:url value="${ book.image }" />" class="card-img-top" /> <div class="card-body"> <h3 class="card-title">${ book.title }</h3> <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="<c:url value='/books/${ book.id }' />" class="btn btn-primary">상세보기</a> <s:authorize access="hasRole('ADMIN')"> <a href="<c:url value='/books/edit/${ book.id }' />" class="btn btn-info">수정</a> <a href="<c:url value='/books/delete/${ book.id }' />" class="btn btn-danger">삭제</a> </s:authorize> </div> </div> </div> </c:forEach> </div> </div> ``` 아래와 같은 화면이 나옵니다. ![Imgur](http://i.imgur.com/ixdN4BK.png)