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:

  1. store array in session variable using session.setattribute();
  2. 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:

  1. 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

Popular posts from this blog

Add email recipient to all new Trac tickets -

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -