Spring JSP:根据TLD或标记文件,标记输入必须使用属性路径

时间:2015-01-29 07:33:09

标签: spring jsp

使用带有ajax的javascript添加输入标签(spring input comp)时。我得到了以下错误。

org.apache.jasper.JasperException: /WEB-INF/views/configurationManagement.jsp (line: 27, column: 14) According to the TLD or the tag file, attribute path is mandatory for tag input
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:237)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:858)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1538)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2433)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1798)

我在div中添加输入标记的代码是。

var $col4div1 = $('<div class="form-group">');
$("<form:input />")
.attr("path","emailGatwayParameter["+ index + "].hostPortNumber")
.attr("id","emailParameterPort"+ index)
.attr("class","form-control")
.appendTo($col4div1);

1 个答案:

答案 0 :(得分:2)

您正在添加没有必需路径属性的<form:input />。它应该是这样的:<form:input path="someParamName" />"someParamName"应匹配此表单的Spring表单对象中的属性。

有关详细信息,请查看spring-form.tld