本文整理匯總了Java中javax.portlet.RenderRequest.getPortletSession方法的典型用法代碼示例。如果您正苦於以下問題:Java RenderRequest.getPortletSession方法的具體用法?Java RenderRequest.getPortletSession怎麽用?Java RenderRequest.getPortletSession使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.portlet.RenderRequest
的用法示例。
在下文中一共展示了RenderRequest.getPortletSession方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleRenderRequest
import javax.portlet.RenderRequest; //導入方法依賴的package包/類
@Override
public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception {
// If the portlet is minimized and we don't want to render then return null.
if (WindowState.MINIMIZED.equals(request.getWindowState()) && !this.renderWhenMinimized) {
return null;
}
// Delegate to PortletContentGenerator for checking and preparing.
checkAndPrepare(request, response);
// Execute in synchronized block if required.
if (this.synchronizeOnSession) {
PortletSession session = request.getPortletSession(false);
if (session != null) {
Object mutex = PortletUtils.getSessionMutex(session);
synchronized (mutex) {
return handleRenderRequestInternal(request, response);
}
}
}
return handleRenderRequestInternal(request, response);
}
示例2: getExpiration
import javax.portlet.RenderRequest; //導入方法依賴的package包/類
/**
* Point at which the JWT expires
*/
protected final Date getExpiration(RenderRequest renderRequest) {
// Expiration of the JWT
final PortletSession portletSession = renderRequest.getPortletSession();
final Date rslt = new Date(
portletSession.getLastAccessedTime() + ((long) portletSession.getMaxInactiveInterval() * 1000L)
);
return rslt;
}