Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Spring: getting values from a list box in jsp into form Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring: getting values from a list box in jsp into form

    I am stuck with a problem with deadline on head
    yaar! please help me

    Actually My application is desinged on spring MVC and hibernate.

    I need to add a new funtionality where user will select a team and the
    list of application they belong and i need save this data in a table.

    UI requirement is that

    They have a text box to enter the team and
    A drop down box where user can select multiple application(table
    application has the list of all application)


    <form:form method="post" action="${request.requestURI}" commandName="form">

    <form:errors path="*" />

    <br/>

    <table><tr><td><div class="standardFont bold">${addType}: </div></td>

    <td><form:input path="text" size="15"/></td></tr>

    <tr><td class="leftColumnWidth standardFont bold">Application suite(S): </td>

    <td class="rightColumnWidth">



    <select class="zIndex" name="applicationID" style="Width: 125" multiple>
    <option value="-1">Select...</option>
    <c:forEach var="application" items="${form.allapplicationNames}">
    <option value=${application.applicationID}>${application.a pplicationName}</option>
    </c:forEach>
    </select>




    </td></tr>

    </table>

    <input type="submit" value="Continue" name="_target1"/>

    <input type="submit" value="Cancel" name="_cancel"/>

    </form:form>







    this is the spring-servlet entry:



    <bean name="addTeam"
    class="com.spring.forms.StandardAddController">

    <property name="commandClass"

    value="com.spring.forms.AddTeamForm" />

    <property name="commandName" value="form" />

    <property name="pages">

    <list>

    <value>addTeam</value>

    <value>addTeamConfirmation</value>

    </list>

    </property>

    <property name="handler">

    <bean class="com.spring.forms.StandardAddHandler">

    <property name="addType" value="Team" />

    <property name="teamDao" ref="teamDAO" />

    <property name="applicationDAO" ref="applicationDAO" />

    </bean>

    </property>

    <property name="validator">

    <bean class="com.spring.forms.addTeamValidator" />

    </property>

    </bean>







    And i don know how do i add setters and getters in the form for
    getting all the application selected by the user.. Please help....



    Is this how form should look like (with getters and setters for the
    variable declared)
    or else how can I make the form get the multiple values(application) selected from the dropdown


    public class AddTeamForm

    {


    @SuppressWarnings("unused")

    private static Log log=LogFactory.getLog(AddTeamForm.class);

    private String text;

    private List<String> applicationID;

    private application application;

    private set<application> allCategories;



    }


    Please tell me if i have gone wrong anywhere in the flow.. And also I am not getting how to map the combo box selection(multiple) into the form.

    Please respond as soon as possible


    Plllllllllease help....
    Last edited by geetha bapuji; Aug 19th, 2010, 09:13 AM.
Working...
X