You can pass an "attribute" between the
servlet and the JSP.
1) In your servlet, before redirecting to your JSP:
request.setAttribute("myID", "Any value passed");
2) In your JSP, to get the attribute:
String myString = (String) request.getAttribute("myID");
In general, you can pass any object, like this:
1) In your servlet, before redirecting to your JSP:
MyClass myObject = new MyClass(...);
request.setAttribute("myID2", myObject);
2) In your JSP, to get the attribute:
MyClass myObject = (MyClass) request.getAttribute("myID2");