Thanks Vincent,that's pretty way for restlet-1.1snapshot.I used this way in
restlet or resource:
TemplateRepresentation templateRepr= new TemplateRepresentation(
                "/people.vm",
                MediaType.TEXT_HTML);
...
templateRepr.setDataModel(dataModel);
        templateRepr.getEngine().setProperty(
                VelocityEngine.FILE_RESOURCE_LOADER_PATH,
                "E:/eclipse3.1RC3/workspace/RestletPractice/templates"
            );
response.setEntity(templateRepr);

I have a lot of problem about it:
1.How to use the relative path to set "file resource loader path" property
of velocity engine?It must to fullfill all of path?
2.How to set once when a Velocitytemplate is initialized,without set again
when you use this template?

On Thu, Feb 28, 2008 at 5:03 AM, Vincent <[EMAIL PROTECTED]> wrote:

> Stuart,
>
> > I'm trying to use the TemplateRepresentation for the Velocity extension
> as part
> > of a webapp, but I am having problems configuring the template location.
>
> Have you tried this:
>
>  org.restlet.ext.velocity.TemplateRepresentation r = new
> org.restlet.ext.velocity.TemplateRepresentation(...);
>
> r.getEngine().setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH,
> "/path/to/resources");
>
>
>
> -vincent.
>
>


-- 
cleverpig
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
Phone: 010-66415588-1113
MSN: [EMAIL PROTECTED]
QQ: 149291732
Skepe: cleverpigatmatrix
My Facebook ID:cleverpig
My Blog: hihere.sohu.com
My Tags: del.icio.us/cleverpig
My Twitter: twitter.com/cleverpig
My Organization: www.beijing-open-party.org
一些值得关注的唧歪:
 http://jiwai.de/t/jmatrix/
 http://jiwai.de/t/db4o/
 http://jiwai.de/t/matrix-community/

Reply via email to