Author: ssolsagl
Date: 2007-04-27 09:16:56 +0200 (Fri, 27 Apr 2007)
New Revision: 4905
Modified:
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/URLVelocityTemplateLoader.java
Log:
add newline before and after actual template otherwise macros doesnt load
correctly
Modified:
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/URLVelocityTemplateLoader.java
===================================================================
---
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/URLVelocityTemplateLoader.java
2007-04-27 06:41:33 UTC (rev 4904)
+++
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/URLVelocityTemplateLoader.java
2007-04-27 07:16:56 UTC (rev 4905)
@@ -46,7 +46,8 @@
* getResourceStream() loads resource from url. Then add border around
the
* template so its easy to see wich templates are loaded.
*/
- public InputStream getResourceStreamDebug(String url)
+ @Override
+ public InputStream getResourceStream(String url)
throws ResourceNotFoundException {
boolean VELOCITY_DEBUG =
"true".equals(System.getProperty("VELOCITY_DEBUG"));
@@ -74,7 +75,8 @@
}
// Create html
- String template= new String(byteContent);
+ String template= "\n" + new String(byteContent) + "\n";
+
StringWriter writer = new StringWriter();
Document doc = createDocument();
@@ -94,7 +96,6 @@
String result = writer.getBuffer().toString();
result = result.replace("<![CDATA[", "");
result = result.replace("]]>", "");
- System.out.println("Tamplate =" + result);
// log.info("Result: " + buffer.toString());
return new ByteArrayInputStream(result.getBytes());
}
@@ -103,8 +104,6 @@
* Get stream from file of or url.
*/
private InputStream getStream(String templatesDir, String
filePath,String url) {
-
- System.out.println("*** Loading: " + templatesDir + filePath +
", or url: " + url);
if(templatesDir == null) {
return super.getResourceStream(url);
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits