How to Pass Array from One Servlet to Another Servlet?

后端 未结 3 1277
花落未央
花落未央 2021-01-23 01:33

I want to pass multiple values from one servlet to another one servlet. Please tell me how to pass that?

3条回答
  •  被撕碎了的回忆
    2021-01-23 01:36

    You can

    • put your array in request context as an attribute using request.setAttribute()
    • forward the request to second servlet using RequestDispatcher.forward()
    • in your second servlet read the value using request.getAttribute()

提交回复
热议问题