 |
上一主题
想请教各位 Garbage Collection 的处理方式,不是很清楚书上写的东西(Thinking In Java ver3)
书上说, garbage collector 是利用 heap..
|
|
下一主题
目前正基于Hibernate来开发一些项目。
建模中,碰到一些问题,不知该如何解决,请教各位。
问题是这样的:假设我需要存储三个类,A,B,C,其中A是B和C的父类。
那么,按照Hibernat..
|
|
|
|
有用过velocity的吗? 有个问题,进来看看吧
|
2003年11月10日 14:14
|
|
|
标签列表
|
|
很简单的问题。 为什么我运行程序后提示我 Unable to find resource 'HelloWorld.vm' 这个例子是网上最简单也举的最多的一个例子。我把HelloWorld.vm和HelloWorld.java放在一个目录下了。 可为什么找不到?
|
|
|
|
|
|
Re: 有用过velocity的吗? 有个问题,进来看看吧
|
2003年11月10日 21:05
|
|
|
//Apply Velocity template engine public StringWriter styleDocumentAndVeloctity( XMLDocument root, String styleVM ) { StringWriter w = new StringWriter(); try { //Init veloctity parameters Runtime.setProperty(Runtime.FILE_RESOURCE_LOADER_PATH, propertiesManager.getInvoiceFormattingDirectoryName()); //Runtime.setProperty(Runtime.INPUT_ENCODING, "ISO-8859-1"); //Runtime.setProperty(Runtime.OUTPUT_ENCODING, "ISO-8859-1"); //Runtime.setProperty(Runtime.RUNTIME_LOG, pathToVelocityLog);
Runtime.init(); Velocity.init();
/* lets make a Context and put data into it */ VelocityContext context = new VelocityContext(); context.put("root", root);
/* lets render a template */ Velocity.mergeTemplate( styleVM, "GB2312", context, w ); //System.out.println(":" + w); } catch (Exception e ) { e.printStackTrace(); System.out.println("Problem merging template : " + e ); } return w; }
看一下这个例子,很早以前做过的一个项目. 主要是这个 Runtime.setPropertyRuntime.FILE_RESOURCE_LOADER_PATH, String xxx)方法,定义了具体在哪个文件夹下查找模板文件. 详细信息请参考velocity的doc.
|
|
|
|
热点TAG:
AOP
cache
缓存
DDD
EJB
集群
设计模式
Hibernate
IOC
JiveJdon
OO
RBAC
Seam
Spring
Struts
anti spam
|