uimping0 20 de nov. de 2019
@RequestMapping ( "/venda/torras/{lote}" ) // buscou o lote
public ModelAndView detalhesLote ( @PathVariable ( "lote" ) String lotes ) {
ModelAndView mv = new ModelAndView ( "plataform/modelo" );
Lote lote = lr . findByLote ( lotes );
lote . getProdutor ();
mv . addObject ( "lote" , lote );
return mv ;
}
…
mexi no codigo e ja consigo via system.out vizualizar os dados, e vejo que o sql busca os dados do produtor, agora preciso mostrar na pagina modelo.html, estou usando o thymeleaf… da o seguinte erro…
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Nov 20 07 : 10 : 16 BRT 2019
There was an unexpected error ( type = Internal Server Error , status = 500 ).
An error happened during template parsing ( template : “ class path resource [ templates / plataform / modelo . html ] ” )
org . thymeleaf . exceptions . TemplateInputException : An error happened during template parsing ( template : “ class path resource [ templates / plataform / modelo . html ] ” )
at org . thymeleaf . templateparser . markup . AbstractMarkupTemplateParser . parse ( AbstractMarkupTemplateParser . java : 241 )
at org . thymeleaf . templateparser . markup . AbstractMarkupTemplateParser . parseStandalone ( AbstractMarkupTemplateParser . java : 100 )
at org . thymeleaf . engine . TemplateManager . parseAndProcess ( TemplateManager . java : 666 )
at org . thymeleaf . TemplateEngine . process ( TemplateEngine . java : 1098 )
at org . thymeleaf . TemplateEngine . process ( TemplateEngine . java : 1072 )
at org . thymeleaf . spring5 . view . ThymeleafView . renderFragment ( ThymeleafView . java : 362 )
at org . thymeleaf . spring5 . view . ThymeleafView . render ( ThymeleafView . java : 189 )
at org . springframework . web . servlet . DispatcherServlet . render ( DispatcherServlet . java : 1373 )
at org . springframework . web . servlet . DispatcherServlet . processDispatchResult ( DispatcherServlet . java : 1118 )
at org . springframework . web . servlet . DispatcherServlet . doDispatch ( DispatcherServlet . java : 1057 )
at org . springframework . web . servlet . DispatcherServlet . doService ( DispatcherServlet . java : 943 )
at org . springframework . web . servlet . FrameworkServlet . processRequest ( FrameworkServlet . java : 1006 )
at org . springframework . web . servlet . FrameworkServlet . doGet ( FrameworkServlet . java : 898 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 634 )
at org . springframework . web . servlet . FrameworkServlet . service ( FrameworkServlet . java : 883 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 741 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 231 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 166 )
at org . apache . tomcat . websocket . server . WsFilter . doFilter ( WsFilter . java : 53 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 193 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 166 )
at org . springframework . web . filter . RequestContextFilter . doFilterInternal ( RequestContextFilter . java : 100 )
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 119 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 193 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 166 )
at org . springframework . web . filter . FormContentFilter . doFilterInternal ( FormContentFilter . java : 93 )
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 119 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 193 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 166 )
at org . springframework . web . filter . CharacterEncodingFilter . doFilterInternal ( CharacterEncodingFilter . java : 201 )
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 119 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 193 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 166 )
at org . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperValve . java : 202 )
at org . apache . catalina . core . StandardContextValve . invoke ( StandardContextValve . java : 96 )
at org . apache . catalina . authenticator . AuthenticatorBase . invoke ( AuthenticatorBase . java : 526 )
at org . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . java : 139 )
at org . apache . catalina . valves . ErrorReportValve . invoke ( ErrorReportValve . java : 92 )
at org . apache . catalina . core . StandardEngineValve . invoke ( StandardEngineValve . java : 74 )
at org . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . java : 343 )
at org . apache . coyote . http11 . Http11Processor . service ( Http11Processor . java : 408 )
at org . apache . coyote . AbstractProcessorLight . process ( AbstractProcessorLight . java : 66 )
at org . apache . coyote . AbstractProtocol $ ConnectionHandler . process ( AbstractProtocol . java : 861 )
at org . apache . tomcat . util . net . NioEndpoint $ SocketProcessor . doRun ( NioEndpoint . java : 1579 )
at org . apache . tomcat . util . net . SocketProcessorBase . run ( SocketProcessorBase . java : 49 )
at java . util . concurrent . ThreadPoolExecutor . runWorker ( Unknown Source )
at java . util . concurrent . ThreadPoolExecutor $ Worker . run ( Unknown Source )
at org . apache . tomcat . util . threads . TaskThread $ WrappingRunnable . run ( TaskThread . java : 61 )
at java . lang . Thread . run ( Unknown Source )
Caused by : org . attoparser . ParseException : Exception evaluating SpringEL expression : “ produtor . nome ” ( template : “ plataform / modelo ” - line 39 , col 58 )
at org . attoparser . MarkupParser . parseDocument ( MarkupParser . java : 393 )
at org . attoparser . MarkupParser . parse ( MarkupParser . java : 257 )
at org . thymeleaf . templateparser . markup . AbstractMarkupTemplateParser . parse ( AbstractMarkupTemplateParser . java : 230 )
… 48 more
Caused by : org . thymeleaf . exceptions . TemplateProcessingException : Exception evaluating SpringEL expression : “ produtor . nome ” ( template : “ plataform / modelo ” - line 39 , col 58 )
at org . thymeleaf . spring5 . expression . SPELVariableExpressionEvaluator . evaluate ( SPELVariableExpressionEvaluator . java : 290 )
at org . thymeleaf . standard . expression . VariableExpression . executeVariableExpression ( VariableExpression . java : 166 )
at org . thymeleaf . standard . expression . SimpleExpression . executeSimple ( SimpleExpression . java : 66 )
at org . thymeleaf . standard . expression . Expression . execute ( Expression . java : 109 )
at org . thymeleaf . standard . expression . Expression . execute ( Expression . java : 138 )
at org . thymeleaf . standard . processor . AbstractStandardExpressionAttributeTagProcessor . doProcess ( AbstractStandardExpressionAttributeTagProcessor . java : 144 )
at org . thymeleaf . processor . element . AbstractAttributeTagProcessor . doProcess ( AbstractAttributeTagProcessor . java : 74 )
at org . thymeleaf . processor . element . AbstractElementTagProcessor . process ( AbstractElementTagProcessor . java : 95 )
at org . thymeleaf . util . ProcessorConfigurationUtils $ ElementTagProcessorWrapper . process ( ProcessorConfigurationUtils . java : 633 )
at org . thymeleaf . engine . ProcessorTemplateHandler . handleOpenElement ( ProcessorTemplateHandler . java : 1314 )
at org . thymeleaf . engine . TemplateHandlerAdapterMarkupHandler . handleOpenElementEnd ( TemplateHandlerAdapterMarkupHandler . java : 304 )
at org . thymeleaf . templateparser . markup . InlinedOutputExpressionMarkupHandler $ InlineMarkupAdapterPreProcessorHandler . handleOpenElementEnd ( InlinedOutputExpressionMarkupHandler . java : 278 )
at org . thymeleaf . standard . inline . OutputExpressionInlinePreProcessorHandler . handleOpenElementEnd ( OutputExpressionInlinePreProcessorHandler . java : 186 )
at org . thymeleaf . templateparser . markup . InlinedOutputExpressionMarkupHandler . handleOpenElementEnd ( InlinedOutputExpressionMarkupHandler . java : 124 )
at org . attoparser . HtmlElement . handleOpenElementEnd ( HtmlElement . java : 109 )
at org . attoparser . HtmlMarkupHandler . handleOpenElementEnd ( HtmlMarkupHandler . java : 297 )
at org . attoparser . MarkupEventProcessorHandler . handleOpenElementEnd ( MarkupEventProcessorHandler . java : 402 )
at org . attoparser . ParsingElementMarkupUtil . parseOpenElement ( ParsingElementMarkupUtil . java : 159 )
at org . attoparser . MarkupParser . parseBuffer ( MarkupParser . java : 710 )
at org . attoparser . MarkupParser . parseDocument ( MarkupParser . java : 301 )
… 50 more
Caused by : org . springframework . expression . spel . SpelEvaluationException : EL1007E : Property or field ‘ nome ’ cannot be found on null
at org . springframework . expression . spel . ast . PropertyOrFieldReference . readProperty ( PropertyOrFieldReference . java : 213 )
at org . springframework . expression . spel . ast . PropertyOrFieldReference . getValueInternal ( PropertyOrFieldReference . java : 104 )
at org . springframework . expression . spel . ast . PropertyOrFieldReference . access $ 000 ( PropertyOrFieldReference . java : 51 )
at org . springframework . expression . spel . ast . PropertyOrFieldReference $ AccessorLValue . getValue ( PropertyOrFieldReference . java : 406 )
at org . springframework . expression . spel . ast . CompoundExpression . getValueInternal ( CompoundExpression . java : 92 )
at org . springframework . expression . spel . ast . SpelNodeImpl . getValue ( SpelNodeImpl . java : 112 )
at org . springframework . expression . spel . standard . SpelExpression . getValue ( SpelExpression . java : 330 )
at org . thymeleaf . spring5 . expression . SPELVariableExpressionEvaluator . evaluate ( SPELVariableExpressionEvaluator . java : 263 )
… 69 more
darlan_machado 20 de nov. de 2019
Talvez você precise referenciar como lote.produtor.nome
Diego_Emmanuell 20 de nov. de 2019
uimping0 21 de nov. de 2019
Feito, deu certinho vlw… kkkkk era simples só falta de pensar…
uimping0 21 de nov. de 2019
era só esse codigo da pergunta acima…