问题
Is it possible to redirect search-Result (portlet: $theme.journalContentSearch() ) to my "http://localhost/search" page?
I need this, because on home-page I don't have any portlets-placeholder, and after submit search-form, I see nothing. If I use this function on other page, it work fine, but stay in same page where I do form-submit, e.g. "/contact?****blablabla****"
/* new */
long searchPlid = plid;
System.out.println(TAG + "plid: " + plid);
//My Hidden search page
Layout searchPage = LayoutLocalServiceUtil.fetchLayoutByFriendlyURL(group.getGroupId(), false, "/search");
if (null != searchPage) {
searchPlid = searchPage.getPlid();
System.out.println(TAG + "searchPlid. " + searchPlid);
}
/* /new */
if (portletResponse != null) {
LiferayPortletResponse liferayPortletResponse = (LiferayPortletResponse)portletResponse;
//portletURL = liferayPortletResponse.createLiferayPortletURL(PortletKeys.SEARCH, PortletRequest.RENDER_PHASE);
portletURL = liferayPortletResponse.createLiferayPortletURL(searchPlid, PortletKeys.SEARCH, PortletRequest.RENDER_PHASE);
}
else {
//portletURL = new PortletURLImpl(request, PortletKeys.SEARCH, plid, PortletRequest.RENDER_PHASE);
portletURL = new PortletURLImpl(request, PortletKeys.SEARCH, searchPlid, PortletRequest.RENDER_PHASE);
}
this doesn't work, because I stay in same page after submit form :(
来源:https://stackoverflow.com/questions/28745208/liferay-6-2-search-result-on-separate-page