I have a JSP with drop down box. I select one option and submit that one. So now I get the information stored in the database of that selected option. Now I refresh the JSP (HTML page) automatically by setting in servlet as
//servlet code inside doGet() method
HttpSession session=request.getSession();
String selUrl=request.getParameter("urlsel");
String opt=session.setAttribute("selectedUrl",selUrl);
String selopt=session.getAttribute("selectedUrl");
response.setHeader("Refresh","10;url="/SiteAvailabilityServlet?ursel="+selectedUrl);
//and forwarding request to result.jsp using RequestDispatcher..
//input.jsp code
<select name="urlsel">
<option value="abc">abc</option>
<option value="def">def</option>
</select>
For the first time when I select the option say abc and submitted manually it is giving me the correct result and showing the details from data base. After 10 seconds it is refreshed automatically with the same option abc (I do not want to change the option), but not displaying values. It is taking the
request.getParameter("urlsel") as null after refreshing automatically.
Please help me. In result.jsp I am using
<form method="get" action="/SiteAvaialabilityServlet">