diff options
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java')
| -rw-r--r-- | projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java index c99768c..327e024 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java @@ -160,9 +160,10 @@ public class WOComponent extends WOElement implements WOActionResults, net.woton if (context != null) { languages = context.request().browserLanguages(); } - WOElement result = templateWithHTMLString( - readTemplateResource(aComponentName, aFramework, TEMPLATE_SUFFIX, languages), - readTemplateResource(aComponentName, aFramework, DECLARATION_SUFFIX, languages), languages); + String htmlString = readTemplateResource(aComponentName, aFramework, TEMPLATE_SUFFIX, languages); + String declarationString = readTemplateResource(aComponentName, aFramework, DECLARATION_SUFFIX, languages); + + WOElement result = templateWithHTMLString(htmlString, declarationString, languages); if (result == null) { System.out.println("WOComponent.templateWithName: failed for " + aComponentName); } @@ -170,7 +171,7 @@ public class WOComponent extends WOElement implements WOActionResults, net.woton } /** - * Returns the root of the tree of elements produced by parsing the specfified + * Returns the root of the tree of elements produced by parsing the specified * HTML string and bindings declaration string. Note: language list is currently * ignored. */ @@ -770,6 +771,7 @@ public class WOComponent extends WOElement implements WOActionResults, net.woton if (name == null) return null; name = name + DIRECTORY_SUFFIX + '/' + name + suffix; + InputStream is = null; if (isCachingEnabled()) { byte[] data = WOApplication.application().resourceManager().bytesForResourceNamed(name, framework, @@ -829,7 +831,10 @@ public class WOComponent extends WOElement implements WOActionResults, net.woton buf.append('\n'); } is.close(); // release the resource - return buf.toString(); + + String resourceBody = buf.toString(); + + return resourceBody; } catch (IOException exc) { System.err.println("Error while reading: " + name); exc.printStackTrace(); |
