2
respostas

Exception ao abrir o form

Exception

org.apache.jasper.JasperException: /WEB-INF/views/produtos/form.jsp (line: [15], column: [1]) Unable to find setter method for attribute: [commandName]
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:115)
    org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:3008)
    org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:3228)
    org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:2414)
    org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1904)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1544)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2389)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2441)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2447)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:470)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2389)
    org.apache.jasper.compiler.Generator.generate(Generator.java:3667)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:257)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:385)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:362)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:346)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:383)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:170)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:316)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1370)
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1116)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
2 respostas

Fala Guilherme, tudo bem?

Troque

commandName="produto"

para

modelAttribute="produto"

Abraço!

Oi Otávio, ja havia tentado fazer essa modificação, porém continua o mesmo erro, tem algo mais q eu possa fazer ?