Please copy and paste this below code and let me know
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ page import="java.io.*,java.sql.* ,ams.database.*,javax.servlet.http.*,javax.servlet.*"%>
<html>
<head>
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<script language="JavaScript">
function loadPage(list)
{
document.checkbox.SelectedIndex.value=list.options[list.selectedIndex].text;
location.href=list.options[list.selectedIndex].value;
document.checkbox.submit();
}
</script>
</head>
<body style=" background-color:#FFFFCC;">
<form name="checkedbox" method="post" action="map.jsp">
<%
try
{
Connection connection =new database().getConnection();
Statement s=null;
Statement st =null;
Statement st1=null;
ResultSet rs =null;
ResultSet rst=null;
ResultSet rst1=null;
s=connection.createStatement();
st = connection.createStatement();
String SelectedIndex=request.getParameter("SelectedIndex");
int id=0;
%>
<%
rs=st.executeQuery("SELECT * from ams_division;"); //"SELECT * from ams_division;"
rst=s.executeQuery("Select * from sec_code ;"); //"Select * from sec_code;"
%>
<input type="hidden" name="SelectedIndex"/>
<select name="combo" id="" onchange="loadPage(this.form.elements[0])" >
<% while(rs.next()){
if(SelectedIndex!=null && SelectedIndex.trim().eualIgnoreCase(ars.getString(2)))
{%>
<option value="mapping.jsp" SELECTED ><%=rs.getString(2) %></option>
<%}else{
%><option value="mapping.jsp" ><%=rs.getString(2) %></option>
<%}%>
<option value="adddiv.jsp">Add New</option>
</select>
Check the Sections of above selected division
| Sec. No. | Sec. Name | Login Id |
<% while(rst.next())
{
%>
<input type="checkbox" name="section" value="<%=rst.getString(2) %>"/> | <%=rst.getInt(1) %> | <%=rst.getString(2) %> | <%=rst.getString(3) %> |
<%
}%>
<%
}
catch(Exception e)
{
}
%>
<input type="submit" value="submit" />
</form>
</body>
</html>