Bom estou fazendo a aula, porém apos tirar dos comentários as duas linhas do inicializator e de alterar o método addInterceptors estou recebem as exceptions:
____________________________________
org.apache.jasper.JasperException: org.apache.jasper.el.JspPropertyNotFoundException: /WEB-INF/views/produto/form.jsp(64,6) '$ {categoria.categorias}' Property 'categorias' não encontradas em tipo br.com.caelum.model.Produto
org.apache.jasper.servlet.JspServletWrapper.handleJspException (JspServletWrapper.java:560)
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:476)
org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service (JspServlet.java:340)
javax.servlet.http.HttpServlet.service (HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:52)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel (InternalResourceView.java:168)
org.springframework.web.servlet.view.AbstractView.render (AbstractView.java:303)
org.springframework.web.servlet.DispatcherServlet.render (DispatcherServlet.java:1244)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult (DispatcherServlet.java:1027)
org.springframework.web.servlet.DispatcherServlet.doDispatch (DispatcherServlet.java:971)
org.springframework.web.servlet.DispatcherServlet.doService (DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest (FrameworkServlet.java:966)
org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.java:857)
javax.servlet.http.HttpServlet.service (HttpServlet.java:622)
org.springframework.web.servlet.FrameworkServlet.service (FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service (HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:52)
Causa raiz
org.apache.jasper.el.JspPropertyNotFoundException: /WEB-INF/views/produto/form.jsp(64,6) '$ {categoria.categorias}' Propriedade 'categorias' não encontradas no tipo br.com.caelum.model .Produto
org.apache.jasper.el.JspValueExpression.getValue (JspValueExpression.java:120)
org.apache.jsp.WEB_002dINF.views.produto.form_jsp._jspx_meth_c_005fforEach_005f2 (form_jsp.java:692)
org.apache.jsp.WEB_002dINF.views.produto.form_jsp._jspx_meth_c_005fforEach_005f1 (form_jsp.java:624)
org.apache.jsp.WEB_002dINF.views.produto.form_jsp._jspService (form_jsp.java:321)
org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service (HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:438)
org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service (JspServlet.java:340)
javax.servlet.http.HttpServlet.service (HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:52)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel (InternalResourceView.java:168)
org.springframework.web.servlet.view.AbstractView.render (AbstractView.java:303)
org.springframework.web.servlet.DispatcherServlet.render (DispatcherServlet.java:1244)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult (DispatcherServlet.java:1027)
org.springframework.web.servlet.DispatcherServlet.doDispatch (DispatcherServlet.java:971)
org.springframework.web.servlet.DispatcherServlet.doService (DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest (FrameworkServlet.java:966)
org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.java:857)
javax.servlet.http.HttpServlet.service (HttpServlet.java:622)
org.springframework.web.servlet.FrameworkServlet.service (FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service (HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:52)
__________________
Alguém pode me ajudar ? segue também os métodos criados na aula:
@Bean
public OpenEntityManagerInViewInterceptor getOpenEntityManagerInViewInterceptor() {
return new OpenEntityManagerInViewInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addWebRequestInterceptor(getOpenEntityManagerInViewInterceptor());
}