在LIFERAY中如何从second.jsp上的first.jsp重定向? [英] how do redirect in LIFERAY from first.jsp on second.jsp?
问题描述
<%
if(my_value==true){
//redirect to page second.jsp
}
%>
这是怎么做的?请在这个问题上帮助我
How do this? please help me in this questions
推荐答案
jsp内的重定向并不是真正的权宜之计,因为在下面的jsp解析呈现阶段和此阶段的概念是为了显示内容.
The redirection inside of jsp isn't realy expedient idea, because jsp-parsing below to render phase and this phase is concepted to show the content.
另一方面,从下面重定向到操作阶段,您可以在此处决定portlet接下来应该做什么.
On the other hand redirection below to action phase, here you can decide what the portlet should do at next.
阅读本教程可以更好地理解portlet的两个阶段: http ://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/understanding-the-two-phases-portlet-execution
Read this tutorial for better understanding the two-phase of portlet: http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/understanding-the-two-phases-of-portlet-execution
因此,将重定向放置在portlet processAction方法中:
Hence, put redirection in portlet processAction methode:
@Override
public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException {
//defaultLandingPage = ...
actionResponse.sendRedirect(defaultLandingPage);
};
否则,如果您确实想在jsp内执行此操作,则可以在第一个jsp中包含第二个jsp:
Else, if you realy want to do this inside of jsp, you can include second jsp in the first jsp:
<liferay-util:include page="second.jsp" />
这篇关于在LIFERAY中如何从second.jsp上的first.jsp重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!