You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "javi ." <ci...@hotmail.com> on 2001/09/06 23:15:29 UTC

xsl by extension

hello everybody!!

i'm new here, and so excuse me if this thread has been
started (and closed) before. and xcuse me for my spelling ;)
my native language is java.

i'm trying to add to tomcat a nice feature of resin:
automatically apply a xsl transformation over all files
with .xtp extension (xml templates).

i've already done it, simply associating that extension
to my servlet. the servlet read the xsl path
from the .xtp itself.

the problem is that i want to allow the jsp code in the
xtp file to be executed, so i must retrieve it via http and not from
the os file system... but when i do it, of course, my
xtp servlet catch de call and began a recursive loop!

is there any way to avoid that? i've look at the code
by about ten hours and i don't see how to manage this
problem...

thank you very much in advance.

Javi Moreno (jv)



ps: i promise to post the servlet ;)

pps: yes, i will try {to take another English course...}


_________________________________________________________________
Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp


Re: xsl by extension

Posted by Jeff Turner <je...@socialchange.net.au>.
Ummm... perhaps invoke Jasper from your servlet?

Class clazz = Class.forName("org.apache.jasper.servlet.JspServlet");
HttpServlet jsp = (HttpServlet) clazz.newInstance();
jsp.init(context);
jsp.service(request, response);

That code is from Cocoon 2's JspGenerator, which uses Jasper to create
XML with JSP, which is then transformed and rendered in the Cocoon
pipeline.

--Jeff


On Thu, Sep 06, 2001 at 09:15:29PM +0000, javi . wrote:
> hello everybody!!
> 
> i'm new here, and so excuse me if this thread has been
> started (and closed) before. and xcuse me for my spelling ;)
> my native language is java.
> 
> i'm trying to add to tomcat a nice feature of resin:
> automatically apply a xsl transformation over all files
> with .xtp extension (xml templates).
> 
> i've already done it, simply associating that extension
> to my servlet. the servlet read the xsl path
> from the .xtp itself.
> 
> the problem is that i want to allow the jsp code in the
> xtp file to be executed, so i must retrieve it via http and not from
> the os file system... but when i do it, of course, my
> xtp servlet catch de call and began a recursive loop!
> 
> is there any way to avoid that? i've look at the code
> by about ten hours and i don't see how to manage this
> problem...
> 
> thank you very much in advance.
> 
> Javi Moreno (jv)
> 
> 
> 
> ps: i promise to post the servlet ;)
> 
> pps: yes, i will try {to take another English course...}

Re: xsl by extension

Posted by "Craig R. McClanahan" <cr...@apache.org>.
In a servlet 2.3 environment (i.e. Tomcat 4) you can do this sort of thing
with a Filter.  You would map *.xtp to the JSP servlet, and then apply
your filter as well to the response.

Craig


On Thu, 6 Sep 2001, javi . wrote:

> Date: Thu, 06 Sep 2001 21:15:29 +0000
> From: javi . <ci...@hotmail.com>
> Reply-To: tomcat-dev@jakarta.apache.org
> To: tomcat-dev@jakarta.apache.org
> Subject: xsl by extension
>
> hello everybody!!
>
> i'm new here, and so excuse me if this thread has been
> started (and closed) before. and xcuse me for my spelling ;)
> my native language is java.
>
> i'm trying to add to tomcat a nice feature of resin:
> automatically apply a xsl transformation over all files
> with .xtp extension (xml templates).
>
> i've already done it, simply associating that extension
> to my servlet. the servlet read the xsl path
> from the .xtp itself.
>
> the problem is that i want to allow the jsp code in the
> xtp file to be executed, so i must retrieve it via http and not from
> the os file system... but when i do it, of course, my
> xtp servlet catch de call and began a recursive loop!
>
> is there any way to avoid that? i've look at the code
> by about ten hours and i don't see how to manage this
> problem...
>
> thank you very much in advance.
>
> Javi Moreno (jv)
>
>
>
> ps: i promise to post the servlet ;)
>
> pps: yes, i will try {to take another English course...}
>
>
> _________________________________________________________________
> Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
>
>