使用所有请求参数将请求从一个jsp转发到另一个jsp? [英] Forwarding the request from one jsp to another jsp with all request parameters?

查看:139
本文介绍了使用所有请求参数将请求从一个jsp转发到另一个jsp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这种情况.用户在浏览器的jsp表单上输入一些内容并提交.在servlet中,我处理请求并向刚刚显示的客户端显示jsp page1 按钮.现在单击继续",我想将此请求转发到另一个在页面1上存在所有请求参数的jsp页面2上.基本上我也想获取第2页上的第一个请求中存在的所有请求参数吗?我不知道该怎么走 为了这?我不认为我可以使用jsp转发,因为只有在我们都希望从jsp(服务器端)而不是客户端转发时,才可以使用jsp?

i have this scenario. User enter some stuff on jsp form in browser and submit. In servlet i process the request and show the jsp page1 to client which has just continue button. Now on click of continue, i want to forward this request to another jsp page2 with all request parameter present on page1. basically i want to get all request parameters which were present in first request on page 2 also? I am not getting how should i go for this? I dont think i can use jsp forward as per my understanding it would work only when both when we want to forward from jsp (on server side) not on client side?

推荐答案

有两种实现方法:

  • 在隐藏字段中输出所有参数,并在第二个请求中提交
  • 将所有内容存储在会话中

这篇关于使用所有请求参数将请求从一个jsp转发到另一个jsp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆