我在JSP页面中使用silviomoreto select box plugin以及Spring MVC表单标签。虽然我可以将其余表单字段绑定到实体类的其他属性,但是在绑定“选择”框值时遇到了问题。我想动态地将选定的选项(允许多个选项)绑定到Hibernate Entity类中的属性/字段。有人可以指导我如何做吗?除此之外,在我的JSP中放置<form:select>
标记后,还会得到 JasperException 。我在这里做什么错了?
这是我的代码。
来自JSP
<form:select path="concerns" class="selectpicker" data-live-search="true" multiple data-title='Choose aleast 1 tag' data-max-options="3">
<form:option value="XXX" label="XXX"/>
<form:option value="XXX" label="XXX"/>
<form:option value="XXX" label="XXX"/>
<form:option value="XXX" label="XXX"/>
<form:option value="XXX" label="XXX"/>
</form:select>
来自实体类(此实体使用另一个称为关注对象的实体)
@Entity
@Table(name="problem")
public class Problem {
//other properties here getting binded
private Set<Concern> concerns;
}
例外
org.apache.jasper.JasperException: /WEB-INF/jsp/home.jsp (line: [323], column: [97]) equal symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41) ~[tomcat-embed-jasper-8.5.31.jar:8.5.31]
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:291) ~[tomcat-embed-jasper-8.5.31.jar:8.5.31]
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:97) ~[tomcat-embed-jasper-8.5.31.jar:8.5.31]
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:233) ~[tomcat-embed-jasper-8.5.31.jar:8.5.31]
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:169) ~[tomcat-embed-jasper-8.5.31.jar:8.5.31]
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:160) ~[tomcat-embed-jasper-8.5.31.jar:8.5.31]
.
.