简体   繁体   中英

Migration from Struts to Spring

I am working on a project in which we are migrating from Struts 1.3 to Spring MVC 3.0.

There is a problem with JSP as discussed below:

tag of Struts is used to retrieve collection from Java class.

My question is that... Is there any tag that can replace <html:optionsCollection> tag of struts to Spring MVC?


<form:select onchange="javascript:changeSelectedType();" property="countryType" styleClass="form-control">                                  
        <html:optionsCollection property="stateType"/>
</form:select></code>

You can simply use this :

<form:select path="country"> 
   <form:option value="NONE" label="--- Select ---"/>
   <form:options items="${countryList}" />
</form:select>

Good luck

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM