Thanks Antonio for your advice.
I can see the references to servlets in [5] et [6]; I'm not sure if they
serve any practical purpose any more in tiles 3.0 and I believe I can
remove them easily enough.
However javax.servlet.* is referered to in the renderers themselves:
tiles-request-freemarker [7] and tiles-request-velocity [8]. That's why
I'm using custom renderers. And the autotags depend on [7] and [8], too.
Now I'm not quite sure what your advice is. You seem to suggest that I
just drop the current implementation and bind the autotags directly to
custom renderers, but at the same time you say I don't need custom
renderers... What did I miss?
Nick
[7]
http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-request/tiles-request-freemarker/
[8]
http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-request/tiles-request-velocity/
On 11-10-16 08:53 AM, Antonio Petrelli wrote:
2011/10/16 Nicolas LE BAS<[email protected]>
After playing around a bit with Tiles 3.0 (from trunk), I think it comes
pretty close to the mark. By using custom renderers and a custom Request
class, I can include my foreign content into my webapp and run the container
outside of a servlet environment...
I think that you don't even need custom renderers at all.
JSP will never run outside of a servlet container of course, but freemarker
and velocity should. Except I believe the way they are implemented in tiles
forces the use of servlets. Am I wrong (that would be wonderful)?
Current implementation of Freemarker[1] and Velocity[2] support are tightly
bound to the servlet environment, but it's not a Tiles fault.
However you are pretty lucky, since Tiles 3 generates code automatically
from the "tiles-template" project [3] through the Autotag subproject [4].
Would it take a lot to refactor the servlet api out of tiles-freemarker and
tiles-velocity ? It seems to me that very few classes would be impacted. Of
course, the configuration would be entirely different.
I think you need only to create your version of
"tiles-autotag-freemarker-runtime" [5] or "tiles-autotag-velocity-runtime"
[6] to remove dependencies to servlets.
HTH
Antonio
[1]
http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-parent/tiles-freemarker/
[2]
http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-parent/tiles-velocity/
[3]
http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-parent/tiles-template/
[4] http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-autotag/
[5]
http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-autotag/tiles-autotag-freemarker-runtime/
[6]
http://svn.apache.org/repos/asf/tiles/framework/trunk/tiles-autotag/tiles-autotag-velocity-runtime/