@Override
public WrappedSession getWrappedSession() {
- return secondRequest.getWrappedSession();
+ return getWrappedSession(true);
+ }
+
+ @Override
+ public WrappedSession getWrappedSession(boolean allowSessionCreation) {
+ return secondRequest.getWrappedSession(allowSessionCreation);
}
@Override
@Override
public WrappedSession getWrappedSession() {
- return new WrappedHttpSession(getSession());
+ return getWrappedSession(true);
+ }
+
+ @Override
+ public WrappedSession getWrappedSession(boolean allowSessionCreation) {
+ return new WrappedHttpSession(getSession(allowSessionCreation));
}
/**
}
return (WrappedHttpServletRequest) request;
}
+
}
\ No newline at end of file
@Override
public WrappedSession getWrappedSession() {
- return new WrappedPortletSession(request.getPortletSession());
+ return getWrappedSession(true);
+ }
+
+ @Override
+ public WrappedSession getWrappedSession(boolean allowSessionCreation) {
+ return new WrappedPortletSession(
+ request.getPortletSession(allowSessionCreation));
}
/**
public String getRequestPathInfo();
/**
- * Gets the session associated with this request.
+ * Gets the session associated with this request, creating a new if there is
+ * no session.
*
* @see WrappedSession
* @see HttpServletRequest#getSession()
*/
public WrappedSession getWrappedSession();
+ /**
+ * Gets the session associated with this request, optionally creating a new
+ * if there is no session.
+ *
+ * @param allowSessionCreation
+ * <code>true</code> to create a new session for this request if
+ * necessary; <code>false</code> to return <code>null</code> if
+ * there's no current session
+ *
+ * @see WrappedSession
+ * @see HttpServletRequest#getSession(boolean)
+ * @see PortletRequest#getPortletSession(boolean)
+ *
+ * @return the wrapped session for this request
+ */
+ public WrappedSession getWrappedSession(boolean allowSessionCreation);
+
/**
* Returns the MIME type of the body of the request, or null if the type is
* not known.