【发布时间】:2015-03-13 15:24:53
【问题描述】:
我有一个简单的带有 Spring 的 J2EE 应用程序。 现在我想从 Java 控制器调用另一个页面。比如我在registrazione.jsp,点击一个按钮,调用registrazioneController.java中的一个方法。
现在我想从registrazioneController.java,调用另一个页面,例如
home.jsp,我想在 get 中传递任何参数。
有可能吗?
这是我单击按钮时使用的方法
registrazioenControlle.java
public ModelAndView internalLoadPage(HttpServletRequest request, HttpServletResponse response, Map model) throws Exception
{
//to do
//call another page for example home.html
request.getRequestDispatcher("home.jsp").forward(request, response);
return new ModelAndView("home", model);
}
我正在尝试使用此代码,但没有找到。
【问题讨论】:
-
你想从控制器做重定向。 stackoverflow.com/questions/2500592/…
-
你总是可以在你的控制器中使用 reidrect
标签: spring-mvc jakarta-ee