Reputation: 1846
I have a scheduleMeet.jsp page
<select name="Dept">
<option value="Personalization">Personalization</option>
<option value="WebDevelopment">WebDevelopment</option>
<option value="MobileApp">MobileApp</option>
</select>
<input type="submit"/>
And I want to send the data when the user selects one of the option from dropdown to a servlet.
Can someone suggest code snippet for the Servlet?
Upvotes: 1
Views: 348
Reputation: 78
String Department= request.getParameter("Dept");
So you will get data from one of option's value. If you don't believe it, you can print out the Department object like:
System.out.println(Department);
Upvotes: 1
Reputation: 37023
You could get multiple selection using :
String[] assignedResources = request.getParameterValues("Dept");
Upvotes: 0