After logging in, username is passed to the servlet containing following form, and is showing as the logged in user. But after submitting this form, I am not able to find a way to pass username to the next servlet as the form action happens on submission. So, RequestDispatcher is not useful. Can anybody help me as to how to pass username to next servlet after this form submission so that I can use username on every single page after login?
pw.print("<Form action=BusSearch method=doGet>");
pw.print("<input type=text name=from placeholder=From class=textbox><br>");
pw.print("<input type=text name=to placeholder=To class=textbox>");
pw.print("<br>");
pw.print("<input type=text name=DOJ placeholder=Date of Journey class=textbox</br>");
pw.print("<button type=submit value=Search class=button>");
pw.print("</Form>");