
Radio buttons are dynamically generated.After selecting radio button & submitting the page , the value of the selected radio button get displayed in that jsp page.
<%
while(rs.next())
{
int Countrycodee = rs.getInt("countrycode");
String countrynamee = rs.getString("countryname");
String statuss =rs.getString("status");
%>
<table border="1" width="100%" align="center">
<tr>
<td width="1000">
<input type= "radio" name="radiobuttonn" value= "<%=Countrycodee%>">
</td>
<td width="1000">
<%=Countrycodee%>`print("code sample");`
</td>
<td width="1000">
<%=countrynamee%>
</td>
<td width="1000">
<%=statuss%>
</td>
</tr>
</table>
}

You have to keep the name attribute same for all radio buttons and you have to use the value attribute also.
1)radio.jsp:
<html> <form method="post" action="radiobuttonvalue.jsp"> Are you a student? <input type="radio" name="sel" value="yes">Yes<input type="radio" name="sel" value="no">No <input type="submit" value="submit"> </form> </html>
2)radiobuttonvalue.jsp:
<% String selectedValue=request.getParameter("sel");
out.println(selectedValue);
%>
For more information, visit the following link: