简体   繁体   English

flex:从jsp页面重定向

[英]flex : redirect from jsp page

i am calling a page.jsp from flex application using http, i am checking for authentication on jsp page.now if user is valid than he should redirect to page2.jsp, and if user is invalid user than he should redirect to page3.jsp, i want to redirect from jsp page not from mxml page. 我正在使用http从Flex应用程序调用page.jsp,正在检查jsp page.now上的身份验证,如果用户有效,则应重定向到page2.jsp,如果用户无效,则应重定向到page3.jsp ,我想从jsp页面而不是从mxml页面重定向。

how should i do this? 我应该怎么做?

Forget page.jsp and use a javax.servlet.Filter which is mapped on an url-pattern of /page2.jsp and does the following job in doFilter() method: 忘记page.jsp并使用javax.servlet.Filter ,它映射到/page2.jspurl-pattern上,并在doFilter()方法中完成以下工作:

if (user is valid) {
    chain.doFilter(request, response); // Just continue request.
} else {
    response.sendRedirect("page3.jsp"); // Redirect to page3.jsp.
}

Then let your Flex app just call page2.jsp . 然后,让您的Flex应用程序仅调用page2.jsp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM