1.4 compat

This commit is contained in:
Keith Donald
2008-04-25 04:43:45 +00:00
parent 159fa56c75
commit abbbcc3bbf
2 changed files with 11 additions and 8 deletions

View File

@@ -199,19 +199,20 @@ public class PortletExternalContext implements ExternalContext {
if (this.isRenderPhase()) {
return flowUrlHandler.createFlowExecutionUrl(flowId, flowExecutionKey, (RenderResponse) response);
} else {
throw new IllegalStateException("Only a render request can obtain an flow execution uri");
throw new IllegalStateException("You can only obtain a flow execution URL in a RenderRequest");
}
}
public Writer getResponseWriter() {
if (!isRenderPhase()) {
throw new IllegalStateException("You can only access a response Writer in a RenderRequest");
}
try {
if (isRenderPhase()) {
return ((RenderResponse) response).getWriter();
} else {
throw new IllegalStateException("Only render requests can obtain response writer");
}
return ((RenderResponse) response).getWriter();
} catch (IOException e) {
throw new IllegalStateException("Unable to obtain response writer", e);
IllegalStateException ise = new IllegalStateException("Unable to access the response Writer");
ise.initCause(e);
throw ise;
}
}

View File

@@ -203,7 +203,9 @@ public class ServletExternalContext implements ExternalContext {
try {
return response.getWriter();
} catch (IOException e) {
throw new IllegalStateException("Unable to obtain response writer", e);
IllegalStateException ise = new IllegalStateException("Unable to access the response Writer");
ise.initCause(e);
throw ise;
}
}