【问题标题】:can i redirect in jsp between 2 web app?我可以在 jsp 中重定向 2 个 Web 应用程序吗?
【发布时间】:2011-07-01 22:38:09
【问题描述】:

您好,我在同一个工作空间中有 2 个 Web 应用程序 如何从第一个 webb 应用程序中的页面重定向到第二个 web 应用程序?

在我使用的一个 webb 应用程序中:

 RequestDispatcher req =request.getRequestDispatcher("vote.jsp");
req.forward(request, response);

如果会话未打开,我想重定向,所以我不能使用它

<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/test/"/> 

我需要像RequestDispatcher这样的东西

【问题讨论】:

    标签: eclipse jsp redirect


    【解决方案1】:

    我的朋友就是这样:

    {out.println("Si votre navigateur ne support pas la redirection automatique <a href='http://localhost:8080/HiberBarti/JSP/session/index.jsp'> Click Ic</a>");
    
    String url ="http://localhost:8080/HiberBarti/JSP/session/index.jsp";
    //encodeRedirectURL(url);
    //sendRedirect(url);
    response.sendRedirect(response.encodeRedirectURL(url));
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-18
      • 2013-07-15
      • 2019-01-16
      • 2014-06-24
      • 1970-01-01
      • 1970-01-01
      • 2013-12-20
      相关资源
      最近更新 更多