【问题标题】:Get response after HttpServletResponse.sendRedirect(String url) method在 HttpServletResponse.sendRedirect(String url) 方法后获取响应
【发布时间】:2015-12-10 11:22:10
【问题描述】:

在调用 HttpServletResponse.sendRedirect(String url) 方法后,我得到了一些响应。我怎样才能得到这个响应? sendRedirect 返回 void。

【问题讨论】:

标签: java servlets


【解决方案1】:

HttpServletResponse.sendRedirect(String url) 响应浏览器指示它访问指定的 URL。

【讨论】:

  • 但是如果我需要显示在重定向页面上的信息,我需要做什么?
  • 此信息被发送到浏览器,而不是服务器。您(服务器端)无法访问它。如果您需要信息,您必须让浏览器将其发送给您。
猜你喜欢
  • 2018-02-07
  • 1970-01-01
  • 2020-10-28
  • 1970-01-01
  • 1970-01-01
  • 2015-04-26
  • 1970-01-01
  • 2021-05-04
  • 1970-01-01
相关资源
最近更新 更多