`
nmw02229
  • 浏览: 8795 次
社区版块
存档分类
最新评论

LINK里面带参数的取法

阅读更多


直接在link里面手动加参数后,在renderRequest取不到。

改造一下就可以了。

比如URL: (themeDisplay.getURLHome()  + /PAGEID ?parameter1=1



public static  HttpServletRequest getAppliRequest(HttpServletRequest request) {
        Object obj = null;
        try {
                Method method = request.getClass().getMethod("getRequest");

                obj = method.invoke(request, (Object[])null);
            }
            catch (Exception e) {
                throw new RuntimeException(
                    "Unable to get the portlet request from ");
            }
            return (HttpServletRequest) obj;
    }





String parameter1= renderRequest.getParameter("parameter1");
    if (parameter1== null) {
        parameter1= BBSCommonUtil.getAppliRequest(PortalUtil.getHttpServletRequest(renderRequest)).getParameter("parameter1");
    }



就可以了。





根据PortletURL和portletid跳到其他PORTLET的方法。

long plid = getPortletId(portlet_id);

LiferayPortletURL url = (LiferayPortletURL) portletURL;
        url.setPlid(plid);
        url.setPortletId(portlet_id);
        url.setLifecycle(PortletRequest.RENDER_PHASE);
        url.setParameter("parameter1", "1");







---------------------------------------------------------------------------------

date tag



<liferay-ui:input-date yearRangeEnd='<%=cal.get(Calendar.YEAR)+10%>'
            yearRangeStart='<%=cal.get(Calendar.YEAR)%>'
            yearParam='<%=String.valueOf(cal.get(Calendar.YEAR))%>'
            monthParam='<%=String.valueOf(cal.get(Calendar.MONTH))%>'
            dayParam='<%=String.valueOf(cal.get(Calendar.DAY_OF_MONTH))%>'
           />

  <liferay-ui:header title="DDDDDDDDDDDDDDDDDDDDD"/>



--------------------------------------------------------------------------------------------------------------

if ((PrefsPropsUtil.getLong(PropsKeys.DL_FILE_MAX_SIZE) > 0) && ((is == null) || (is.available() > PrefsPropsUtil.getLong(PropsKeys.DL_FILE_MAX_SIZE)))) { throw new FileSizeException(fileName); }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics