//This is html page
<Html>
<from action="/servlet/xyz">
<input type="text" name="USERID">
</form>
</html>
//servlet
public void service(HttpServletRequest req, HttpServletResponse res)
throws IOException,ServletException{
//This userid getting from html page
String userId=req.getParameter("USERID");
}