2014-04-01 75 views
-1

春季为bindStatus路径我有这样一个模型对象,因此:嵌套地图物业

class Model { 

    SubModel submodel = new SubModel(); 

} 

class SubModel { 

    Map props = Maps.newHashmap(); 
} 

和JSP我想它们绑定到输入像这样:

<spring:bind path="submodel.props['key']"> 
....input... 
....errors..... 
</spring:bind> 

而且我越来越下例外:

Caused by: java.lang.IllegalArgumentException: Type must not be null 
    at org.springframework.util.Assert.notNull(Assert.java:112) 
    at org.springframework.core.convert.AbstractDescriptor.<init>(AbstractDescriptor.java:35) 
    at org.springframework.core.convert.ClassDescriptor.<init>(ClassDescriptor.java:31) 
    at org.springframework.core.convert.TypeDescriptor.<init>(TypeDescriptor.java:563) 
    at org.springframework.core.convert.TypeDescriptor.valueOf(TypeDescriptor.java:125) 
    at org.springframework.validation.AbstractPropertyBindingResult.findEditor(AbstractPropertyBindingResult.java:165) 
    at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:125) 

是否有可能使用BindStatus嵌套地图? 顺便说一句,jstl的作品,但我想要一个更简洁的方式来绑定值和错误。

+0

没有足够的代码来真正理解你所得到的'submodel'你想在春天标签访问。 – developerwjk

回答