2014-04-01 101 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

回答