Author: ilya_shaikovsky
Date: 2010-11-01 07:21:56 -0400 (Mon, 01 Nov 2010)
New Revision: 19815
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java
Log:
https://jira.jboss.org/browse/RF-9114
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java
===================================================================
---
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java 2010-11-01
11:08:21 UTC (rev 19814)
+++
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java 2010-11-01
11:21:56 UTC (rev 19815)
@@ -52,7 +52,12 @@
in.close();
}
}
-
+
+ private void renderLabel(FacesContext context, String label) throws IOException{
+ ResponseWriter writer = context.getResponseWriter();
+ writer.writeText(label.toCharArray(), 0, label.length());
+ }
+
private void renderContent(FacesContext context) throws IOException {
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
String src = getSrc();
@@ -61,10 +66,10 @@
if (stream != null) {
renderStream(context, stream);
} else {
- throw new NullPointerException("resource for highlight not
found");
+ renderLabel(context, "resource for highlight not found");
}
} else {
- throw new NullPointerException("src may not be null");
+ renderLabel(context, "src may not be null");
}
}