Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

the code resulting from the compiled mustaches is not Serializable, h…

…ad to wrap it in a Ehcache Element; thinking of a better to do this .... Any takers?! :)
  • Loading branch information...
commit 86bdbfc286335c839aec41a51f7d42e940169727 1 parent 2938fcb
@florinpatrascu authored
View
BIN  mustache/lib/mustache-0.1.1.jar
Binary file not shown
View
9 mustache/src/ca/simplegames/micro/viewers/mustache/MustacheViewRenderer.java
@@ -28,6 +28,7 @@
import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.Mustache;
import com.github.mustachejava.MustacheFactory;
+import net.sf.ehcache.Element;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -64,10 +65,12 @@ public long render(String path, Repository repository, MicroContext context, Wri
StringWriter sw = new StringWriter();
StringReader source = new StringReader(repository.read(path));
if (mustaches != null) {
- mustache = (Mustache) mustaches.get(key);
- if (mustache == null) {
+ Element mustacheElement = (Element) mustaches.get(key);
+ if (mustacheElement == null) {
mustache = mf.compile(source, Globals.UTF8);
- mustaches.put(key, mustache);
+ mustaches.put(key, new Element(NAME, mustache));
+ }else{
+ mustache = (Mustache) mustacheElement.getObjectValue();
}
} else {
mustache = mf.compile(source, Globals.UTF8);
Please sign in to comment.
Something went wrong with that request. Please try again.