Hola, estoy intentando hacer un CRUD con las tecnologías mencionadas en el titulo pero no se que pasa, me sale error al cargar la página. este es mi html.
<div th:insert="layout/header :: header"></div>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#agregarNoticiaModal">Agregar
</button>
<div class="modal fade" id="agregarNoticiaModal" tabindex="-1" role="dialog" aria-labelledby="addClassModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="agregarNoticiaModalLabel">Agregar
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<form action="#" method="POST" th:action="@{/save}" th:object="${noticia}">
class="form-control" id="titulo" value="" th:name="titulo" />
class="form-control" id="descripcion" value=""
th:name="descripcion" />
<input id="fileUpload" type="file" style="margin-left: 20px" value="" th:name="imagen" />
<input type="submit" value="Aceptar" />
<table class="table table-bordered table-responsive p-3"> <thead class="thead-dark"> <th style="width: 6%">ID
</th> <th style="width: 10%">Imagen
</th> <th style="width: 11%">Fecha
</th> <th style="width: 10%">Editar
</th> <th style="width: 10%">Eliminar
</th> <tr class="text-center" th:each="noticia : ${list}"> <td th:text="${noticia.id}"></td> <td th:text="${noticia.titulo}"></td> <td th:text="${noticia.descripcion}"></td> <td><img class="card-img-top m-auto" th:src="${noticia.imagen}"></td> <td th:text="${noticia.fecha}"></td> <td><a class="btn btn-warning">Editar
<i class="fa fa-edit"></i></a></td> <input type="hidden" name="id" /> <button type="submit" class="btn btn-danger"> Eliminar
<i class="fa fa-trash"></i>
<nav aria-label="Pagination">
<ul class="pagination justify-content-center"> th:classappend="${prev == 0 ? 'disabled': ''}"><a class="page-link" th:href="@{|/noticias/?page=${prev}|}">Anterior
</a></li> <li class="page-item" th:each="page : ${pages}" th:classappend="${current == page ? 'active': ''}"><a class="page-link" th:href="@{|/noticias/?page=${page}|}"
th:text="${page}"></a></li> th:classappend="${current == last ? 'disabled': ''}"><a class="page-link" th:href="@{|/noticias/?page=${next}|}">Siguiente
</a></li> </nav>
<div th:insert="layout/footer :: footer"></div>
Y los métodos de mi controlador para guardar son estos:
@RequestMapping(value = "/save", method = RequestMethod.POST)
public String save
(@ModelAttribute
("noticia") Noticia noticia
) { this.noticia.save(noticia);
return "redirect:/";
}
Que puede ser? Tambien sucede que cuando hago un alta me redirecciona al /index , cuando debería ser a /noticias :(