/** * Prints the stack trace of this exception to the standard error stream. */ public void printStackTrace() { this.printStackTrace(System.err); }
/** * Prints the stack trace of this exception to the specified print stream. * * @param out the <code>PrintStream</code> to be used for output */ public void printStackTrace(java.io.PrintStream out) { this.printStackTrace(new java.io.PrintWriter(out, true)); }
/** * Release resources, specifically it destroys the bridge. */ @Override public void destroy() { try { getBridge().destroy(); } catch (PortletException e) { e.printStackTrace(); } }
@Override public void destroy() { try { getBridge().destroy(); } catch (PortletException e) { e.printStackTrace(); } super.destroy(); }
@Override protected void doHeaders(RenderRequest renderRequest, RenderResponse renderResponse) { try { // Streaming portals like WebSphere (as opposed to buffered portals like Liferay) will set the // javax.portlet.render_part request attribute to a value of "RENDER_HEADERS" which will cause // javax.portlet.GenericPortlet (the superclass of this class) to call this doHeaders(RenderRequest, // RenderResponse) method, but will not in turn call GenericPortlet.doDispatch(RenderRequest, // RenderResponse). That also means that that the doView(RenderRequest, RenderResponse) will not be called // in this class. So if the attribute is set, we call the Bridge.doFacesRequest(RenderRequest, // RenderResponse) method here, so that the Faces lifecycle can be run, and resources added to // h:head can be retrieved. Note that it is the responsibility of the bridge to check for this // attribute as well, because at this point the bridge should not render any JSF views to the response. Object renderPartAttribute = renderRequest.getAttribute(RenderRequest.RENDER_PART); if ((renderPartAttribute != null) && renderPartAttribute.equals(RenderRequest.RENDER_HEADERS)) { Bridge facesBridge = getFacesBridge(renderRequest, renderResponse); facesBridge.doFacesRequest(renderRequest, renderResponse); } } catch (PortletException e) { // Unfortunately the signature for GenericPortlet.doHeaders(RenderRequest, RenderResponse) does not throw // an exception, so we have no choice but to simply report any exceptions by printing the stacktrace. e.printStackTrace(); } } }
@Override protected void doHeaders(RenderRequest renderRequest, RenderResponse renderResponse) { try { // Streaming portals like WebSphere (as opposed to buffered portals like Liferay) will set the // javax.portlet.render_part request attribute to a value of "RENDER_HEADERS" which will cause // javax.portlet.GenericPortlet (the superclass of this class) to call this doHeaders(RenderRequest, // RenderResponse) method, but will not in turn call GenericPortlet.doDispatch(RenderRequest, // RenderResponse). That also means that that the doView(RenderRequest, RenderResponse) will not be called // in this class. So if the attribute is set, we call the Bridge.doFacesRequest(RenderRequest, // RenderResponse) method here, so that the Faces lifecycle can be run, and resources added to // h:head can be retrieved. Note that it is the responsibility of the bridge to check for this // attribute as well, because at this point the bridge should not render any JSF views to the response. Object renderPartAttribute = renderRequest.getAttribute(RenderRequest.RENDER_PART); if ((renderPartAttribute != null) && renderPartAttribute.equals(RenderRequest.RENDER_HEADERS)) { Bridge facesBridge = getFacesBridge(renderRequest, renderResponse); facesBridge.doFacesRequest(renderRequest, renderResponse); } } catch (PortletException e) { // Unfortunately the signature for GenericPortlet.doHeaders(RenderRequest, RenderResponse) does not throw // an exception, so we have no choice but to simply report any exceptions by printing the stacktrace. e.printStackTrace(); } } }
@Override protected void doHeaders(RenderRequest renderRequest, RenderResponse renderResponse) { try { // Streaming portals like WebSphere (as opposed to buffered portals like Liferay) will set the // javax.portlet.render_part request attribute to a value of "RENDER_HEADERS" which will cause // javax.portlet.GenericPortlet (the superclass of this class) to call this doHeaders(RenderRequest, // RenderResponse) method, but will not in turn call GenericPortlet.doDispatch(RenderRequest, // RenderResponse). That also means that that the doView(RenderRequest, RenderResponse) will not be called // in this class. So if the attribute is set, we call the Bridge.doFacesRequest(RenderRequest, // RenderResponse) method here, so that the Faces lifecycle can be run, and resources added to // h:head can be retrieved. Note that it is the responsibility of the bridge to check for this // attribute as well, because at this point the bridge should not render any JSF views to the response. Object renderPartAttribute = renderRequest.getAttribute(RenderRequest.RENDER_PART); if ((renderPartAttribute != null) && renderPartAttribute.equals(RenderRequest.RENDER_HEADERS)) { Bridge bridge = getFacesBridge(renderRequest, renderResponse); bridge.doFacesRequest(renderRequest, renderResponse); } } catch (PortletException e) { // Unfortunately the signature for GenericPortlet.doHeaders(RenderRequest, RenderResponse) does not throw // an exception, so we have no choice but to simply report any exceptions by printing the stacktrace. e.printStackTrace(); } }
@Override protected void doHeaders(RenderRequest renderRequest, RenderResponse renderResponse) { try { // Streaming portals like WebSphere (as opposed to buffered portals like Liferay) will set the // javax.portlet.render_part request attribute to a value of "RENDER_HEADERS" which will cause // javax.portlet.GenericPortlet (the superclass of this class) to call this doHeaders(RenderRequest, // RenderResponse) method, but will not in turn call GenericPortlet.doDispatch(RenderRequest, // RenderResponse). That also means that that the doView(RenderRequest, RenderResponse) will not be called // in this class. So if the attribute is set, we call the Bridge.doFacesRequest(RenderRequest, // RenderResponse) method here, so that the Faces lifecycle can be run, and resources added to // h:head can be retrieved. Note that it is the responsibility of the bridge to check for this // attribute as well, because at this point the bridge should not render any JSF views to the response. Object renderPartAttribute = renderRequest.getAttribute(RenderRequest.RENDER_PART); if ((renderPartAttribute != null) && renderPartAttribute.equals(RenderRequest.RENDER_HEADERS)) { Bridge bridge = getFacesBridge(renderRequest, renderResponse); bridge.doFacesRequest(renderRequest, renderResponse); } } catch (PortletException e) { // Unfortunately the signature for GenericPortlet.doHeaders(RenderRequest, RenderResponse) does not throw // an exception, so we have no choice but to simply report any exceptions by printing the stacktrace. e.printStackTrace(); } }