Let's just go through what your code does
<td><input name="district" type="radio" value="<%=rs.getString("UserID") %>" required="true"/></td>
...
<%
String x = request.getParameter("district");
session.setAttribute("userid", x);
%>
You are outputting an HTML form with a field called district. And at the same time you are reading district from the request and saving it to the session. Since district isn't in the request, you are reading a NULL, and saving NULL in the session. How would it be in the request when you are just now outputting the form? The user can't submit the form before you've output the form to the user, can they?
Then when you submit the form, in your servlet you are reading from the session:
String x=session.getAttribute( "userid" ).toString();
You are reading the NULL you saved into the session when you were building the form. You are not reading the form that the user actually submitted.
What should you be doing? Reading from the request in the servlet:
String x = request.getParameter("district");
The request with a parameter district is generated when the user submits the form, so the request is being sent to the servlet and you should read from the request there.
Or, another way would be to save to the session from the rs.getString("UserID")
:
<%
session.setAttribute("userid", rs.getString("UserID"));
%>
That might be what you want, since UserID probably is something that should be session scope rather than request, and since you don't want the user changing their userid in the form and manipulating things. Then you can still read from the session in your servlet.