I'm using radio buttons on a
JSP which displays all the countries I have in my database. Each row contains a radio button and this radio button has the value of the ID of the country record.
The JSP contains therefore :
<td><input type="radio" name="landSelectie" value="<%=land.getID()%>"></td>
With the submit button I hand the control over to the servlet. The servlet knows the name of the form and so knows which function it should call. This function then controlls the value of the selected radio button and therefore knows the ID of the country record. This record is then looked up end displayed in de detail Form of another JSP.
The controlling of the value of the radio button is as follows :
int landID = DaUtil.vanStringNaarInt(request.getParameter("landSelectie"));
System.out.println("voor landdao - opzoeken van land ID " + landID);
LandDao landDao = new LandDao();
try {
Land land = landDao.zoekLandOpID(landID);
HttpSession session = request.getSession(false);
System.out.println("voor noteren land in sessie");
session.setAttribute("land",land);
requestedPage = DETAIL_LAND_PAGE;
} catch (SQLException sqlEx)