hello Gan123,

it's not clear from your message if you are, or not, able to access the 
template directory at all.  in other words are you able to load the 
...myApplication.propeties file in one application but not the other?

i would suggest you first ensure that you can indeed access this properties 
file by may be building a small TestCase that just loads this file with the 
CLAP client and print its contents.


On Tuesday 30 December 2008 00:21:33 Gan123 wrote:
> Hi,
>
>       I am creating two maven projects. my first maven project is having
> the Application class, this contains free marker configuration. the FTL
> files reffered by this configuration are in second project, which is a
> web application.The project1 is added as dependency to project2.
>
> Application class source code ( project 1 )
>
> private Configuration fmc;
> public TestApplication() throws IOException{
>       getConnectorService().getClientProtocols().add(Protocol.FILE);
>       getConnectorService().getClientProtocols().add(Protocol.CLAP);
>       Properties properties =
> getProperties("clap://class/config/myApplication.properties");
>
>       this.webRootPath = properties.getProperty("web.root.path");
>       try {
>             final File templateDir = new File(webRootPath + "/template");
>             this.fmc = new freemarker.template.Configuration();
>             this.fmc.setDirectoryForTemplateLoading(templateDir);
>         } catch (Exception e) {
>       ....
>       ....
>
> directory structure of project 2
>
> HotelWebApp
> --src
> ----main
> ------webapp
> --------template
> -----------listHotels.ftl
>
> when i run the second project it is throwing exception .. stack trace is
> below..
>
> java.io.FileNotFoundException: \template does not exist.
>       at
> freemarker.cache.FileTemplateLoader$1.run(FileTemplateLoader.java:125) at
> java.security.AccessController.doPrivileged(Native Method)
>       at
> freemarker.cache.FileTemplateLoader.<init>(FileTemplateLoader.java:122)
> at
> freemarker.cache.FileTemplateLoader.<init>(FileTemplateLoader.java:108)
> at
> freemarker.template.Configuration.setDirectoryForTemplateLoading(Configur
>ation.java:314) ----
> ----
>
> can any one please help me to solve this issue? i am trying this by
> following
> "\restlet-1.1.1\src\org.restlet.example\org\restlet\example\book\restlet\
>ch8" sample application.
>
> Thanks in advance.

-- 
cheers;
rsn

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

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to