/* (non-Javadoc)
* @see org.jasig.portal.url.IPortalRequestUtils#getCurrentPortalRequest()
*/
public HttpServletRequest getCurrentPortalRequest() {
final RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (requestAttributes instanceof ServletRequestAttributes) {
final HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest();
try {
return this.getOriginalPortalRequest(request);
}
catch (IllegalArgumentException iae) {
return request;
}
}
else if (requestAttributes instanceof PortletRequestAttributes) {
final PortletRequest request = ((PortletRequestAttributes)requestAttributes).getRequest();
return this.getOriginalPortalRequest(request);
}
else {
throw new IllegalStateException("No ServletRequestAttributes or PortletRequestAttributes available from the RequestContextHolder. " + (requestAttributes == null ? null : requestAttributes.getClass().getName()));
}
}