Author: nbelaevski
Date: 2008-08-07 20:59:54 -0400 (Thu, 07 Aug 2008)
New Revision: 9983
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
Log:
https://jira.jboss.org/jira/browse/RF-4116
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2008-08-08
00:07:25 UTC (rev 9982)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2008-08-08
00:59:54 UTC (rev 9983)
@@ -484,8 +484,16 @@
ResponseWriter writer = context.getResponseWriter();
try {
StringWriter stringWriter = new StringWriter();
- context.setResponseWriter(oldResponseWriter.cloneWithWriter(stringWriter));
+ if (oldResponseWriter != null) {
+ context.setResponseWriter(oldResponseWriter.cloneWithWriter(stringWriter));
+ } else {
+ context.setResponseWriter(this.renderKit.createResponseWriter(
+ stringWriter, "text/html",
+ "US-ASCII"));
+ }
+
+
EXTENDED_SKINNING_ON_RESOURCE.encode(context, null);
stringWriter.flush();
@@ -496,7 +504,9 @@
"on the page together with the following code: \n" +
stringWriter.getBuffer().toString() +
"\nfor extended level of skinning to work.");
} finally {
- context.setResponseWriter(writer);
+ if (writer != null) {
+ context.setResponseWriter(writer);
+ }
}
applicationMap.put(EXTENDED_SKINNING_ON_NO_SCRIPTS_INFO_KEY, Boolean.TRUE);
@@ -517,7 +527,9 @@
} catch (IOException e) {
throw new FacesException(e.getLocalizedMessage(), e);
} finally {
- context.setResponseWriter(oldResponseWriter);
+ if (oldResponseWriter != null) {
+ context.setResponseWriter(oldResponseWriter);
+ }
}
}
}