Search code examples
springmodel-view-controllermigrationstruts-1

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>

Solution

  • You can simply use this :

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

    Good luck