RE: OAuth2: How to resolve Unable to get the template authorize.html.

2012-07-25 Thread Thierry LAU
Hi Richard

Please try the solution described here : 
http://stackoverflow.com/questions/9651019/cant-get-resource-files-in-my-template-files-using-restlet-and-freemarker

It consiste to add the following lines in your codes :

Configuration configuration = new Configuration();
configuration.setTemplateLoader(
new ClassTemplateLoader(ClassInTheClasspath.class,
/rootpath/under/classpath/);
configuration.setObjectWrapper(new DefaultObjectWrapper());

I had the same problem as you and manage to get it resolved

Thierry LAU

Best Regards

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2992867


RE: OAuth2: How to resolve Unable to get the template authorize.html.

2012-07-25 Thread Richard Berger
Thank you for the response.  I was able to use setTemplateLoader to get my
own code to point at a particular  directory - but I didn't see how to
change what AuthPageServerResource was doing (without of course changing
that code and having my own version of it - which I didn't want to do).  

Did you find a way to change the behavior of AuthPageServerResource?  

Thanks again,
RB




--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/OAuth2-How-to-resolve-Unable-to-get-the-template-authorize-html-tp7575959p7578246.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2993078


Re: OAuth2: How to resolve Unable to get the template authorize.html._130102

2012-05-25 Thread Laszlo Hordos
Hi Richard,

The ContextTemplateLoader ctl = new ContextTemplateLoader(getContext(), 
clap:///); loads the templates from the class path and in a WAR this is 
WEB-INF/classes and WEB-INF/lib. You have to put to 
WEB-INF/classes/authorize.html and it will find the page.

Other alternatives you can use the ContextTemplateLoader ctl = new 
ContextTemplateLoader(getContext(), war:///WEB-INF/oauth2) 

Regards,
Laszlo

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2964991


RE: Re: OAuth2: How to resolve Unable to get the template authorize.html._130102

2012-05-25 Thread Richard Berger
Thanks so much!  The /classes directory wasn't visible in Eclipse so I didn't 
think to try there.  So I just copied the files using Windows and that worked 
perfectly!

Thanks again,
RB

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2965075