RE: Accessing templates in jars

"Tim Pizey" <[email protected]>
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
Hi Keats, 

Thank you so much for staying with me. 
I have fixed it!

The initial change, of passing in the servlet 
was correct, however it highlighted another problem 
specific to servlet containers. 

> From: Keats Kirsch
> 
> I just tried a little test and it works fine for me with Tomcat 4.1.
> 
> See if you can modify the HelloWorld Servlet to load the 
> template from a JAR.

This worked, so I realised the problem was in my code, 
as it always is !

I had     
 return "org" + File.separatorChar + 
           "melati" + File.separatorChar + 
           "admin" + File.separatorChar + 
           name;

Which works outside of jar files but not inside them.

    return "org/melati/admin/" + name;

works in both cases.

I should have spotted the error earlier 
as it said it could not find template 
org/melati/admin/Main.wm 

So thank you again for keeping me at it until 
I spotted my mistake. 


yours
tim

PS Melati can now be dropped into another application 
simply by adding the jar, two properties files and 
the images directory into your war file. 




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.