java - How to Pass Array from One Servlet to Another Servlet? -
i want pass multiple values 1 servlet 1 servlet. please tell me how pass that?
depending if use sessions:
- store array in session variable using session.setattribute();
- retrieve array using session.getattribute();
however variable stay until session dies, overwrite else, or remove it.
if forward 1 servlet servlet, can store in request variable:
- request.setattribute()
which can read after forwarding using request.getattribute() after calling
requestdispatcher.forward()
note not work if you're doing redirect instead of servlet forward.
Comments
Post a Comment