本文整理汇总了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;
}