This came up a ways back; people were looking for more flexibility in terms
of where to store the HTML template.  No feature request was ever added,
however.

Currently, Tapestry is very rigid on this; it expects the HTML template(s)
to be in the same location as the specification file (the .jwc).  .jwc's are
located on the classpath, i.e., inside WEB-INF/classes.

One option for you is to create your own implementation of ITemplateSource
(subclassing DefaultTemplateSource); this is the class that is responsible
for locating and loading templates.  Your subclass can look for templates
first in the WEB-INF directory (i.e., as a context asset), then on the
classpath (as the default implementation does).

If there's enough interest I can extend the framework.

One option I like is to define an asset with a special name, perhaps
"_template" or "$template$", that points to the actual template.  This would
allow template to be stored in the web application context (i.e., in the
WAR, but not in WEB-INF).

If you want to store .jwc files elsewhere, it similar, except that you need
to replace the DefaultSpecificationSource.

----- Original Message -----
From: "quorus usability dep." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 6:54 AM
Subject: [Tapestry-developer] tempates location


> Hi!
> If I do not want to store *.html & *.jwc files under the WEB-INF/classes
> directory, what should I do? Actually, I need to place all html/jwc files
> somewhere here:
>
> -web-apps
>        -modules
>          [dir] some/template/dir {some more templates}
>          [file] Home.html
>          [file] Home.jwc
>
>        -WEB-INF
>               [dir] classes /com /myapp/mymodule/servlets/TestServlet
> {returns path to "../../../../../my.application"}
>               [file] my.application {??? need to map to Home.jwc}
>               [file] web.xml
>
> if i put MODULES dir under WEB-INF/classes and write this: <page
name="Home"
> specification-path="/modules/registry/Home.jwc"/> in my.application file -
> all works fine. But I do not want to store templates under WEB-INF. Any
> experiments with ../modules & D:\\temp\\modules\\Home.jwc were negative.
>
> Phil
> P.S. well, kinda stupid question, sorry.
>
>
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to