HelloServlet below contains a HTML form with a dropdown menu. On submission, preocessrequest servlet is called.

Java Code:
public class HelloServlet extends HttpServlet {
public void service (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
PrintWriter out = res.getWriter();
out.println("Welcome");
out.println("<html><form method=\"GET\" action=\"preocessrequest\"
 enctype=\"multipart/form-data\">");

out.println("<p>");
out.println("<select size=\"1\" name=\"imagedd\">");
out.println("<option value =\"city1\">City1</option>");
out.println("<option value =\"city2\">City2</option>");
out.println("</select></p>");
out.println("<p><input type=\"submit\" value=\"Submit\" 
name=\"B1\"></p></form></html>");
out.close();
}
}