开发者

can i redirect in jsp between 2 web app?

Hello i have 2 web app in the same worke space How can i redirec开发者_如何转开发t from page in the 1st webb app to the 2nd web app ?

in one webb app i use :

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

i want redirect if the session is not open so i can't use that

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

i need some thing like the RequestDispatcher


My friend do like that :

{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));
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜