我正在使用spring3和hibernate开发这种简单形式:

<form:form method="post" action="addClass" commandName="trainingclass">
    <form:hidden path="id" />

和相应的命令:

@Entity
@Table(name="TrainingClass")
public class TrainingClass {
    @Id
    @Column(name="ID")
   // @GeneratedValue
    private Integer id;
    ....
}

标题中出现异常。 我尝试使用一些临时属性,例如:

@Entity
@Table(name="TrainingClass")
public class TrainingClass {
    @Id
    @Column(name="ID")
   // @GeneratedValue
    private Integer id;

    private Integer dim;
}

<form:form method="post" action="addClass" commandName="trainingclass">
        <form:hidden path="dim" />

仍然有例外。

然后我尝试了:

<form:form method="post" action="addClass" commandName="trainingclass">
            <form:hidden path="dim" value="dummy"/>

还是一样的问题。

我搜索了google,并且搜索到的所有地方都没有出现任何问题。

异常跟踪:

org.apache.jasper.JasperException: /WEB-INF/jsp/trainingClassForm.jsp (line: 13, column: 2) The form:hidden tag declares that it accepts dynamic attributes but does not implement the required interface
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:832)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1538)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:895)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1538)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2433)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)
    org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1817)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

请提出如何解决此问题的建议。

谢谢

  ask by user1539343 translate from so

本文未有回复,本站智能推荐: