You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "L.Fernando" <fe...@stts.com.br> on 2001/08/09 23:39:29 UTC

How to execute a dynamic JSP from a Servlet WITHOUT sending it to disk first ?

Hi All,
I have the following problem:

Based on some database data, one Servlet dynamicly generates an JSP page
text inside an string buffer.

The question is:

How to execute that "page" without having to write it to disk before
dispatching it ? I mean, how to send that string buffer (with my "page"
inside it) directly to the jsp interpreter servlet ?

Any help will be welcome !

Thanks in advance,

Fernando.




Re: How to execute a dynamic JSP from a Servlet WITHOUT sending it to disk first ?

Posted by "L.Fernando" <fe...@stts.com.br>.
Thanks a lot for your help Andrey.
I'll be taking a look at the projects you talk about.

Best regards,

Fernando.

----- Original Message -----
From: "Andrey Aristarkhov" <Ar...@jbuilder.ru>
To: <to...@jakarta.apache.org>
Sent: Thursday, August 09, 2001 7:24 PM
Subject: RE: How to execute a dynamic JSP from a Servlet WITHOUT sending it
to disk first ?


> Hi,
>
> it's not good practice since it well be heavy processor load.
> Actually JSP being transformed to servlet, and JspServlet forward incoming
> request to it. JSP is not an interpriter. JSP page need to be compiled
into
> servlet each time its (JSP) source changes on disk if it's the first
request
> to a page. For your situation XML/XSL transformation is better solution.
> Lookup at Xalan or Coccon project at xml.apache.org.
>
> Regards,
> Andrey
>
> > -----Original Message-----
> > From: L.Fernando [mailto:fernando@stts.com.br]
> > Sent: Friday, August 10, 2001 1:39 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: How to execute a dynamic JSP from a Servlet WITHOUT
> > sending it to disk first ?
> >
> >
> > Hi All,
> > I have the following problem:
> >
> > Based on some database data, one Servlet dynamicly generates an JSP page
> > text inside an string buffer.
> >
> > The question is:
> >
> > How to execute that "page" without having to write it to disk before
> > dispatching it ? I mean, how to send that string buffer (with my "page"
> > inside it) directly to the jsp interpreter servlet ?
> >
> > Any help will be welcome !
> >
> > Thanks in advance,
> >
> > Fernando.
> >
> >
> >
> >
>
>


RE: How to execute a dynamic JSP from a Servlet WITHOUT sending it to disk first ?

Posted by Andrey Aristarkhov <Ar...@jbuilder.ru>.
Hi,

it's not good practice since it well be heavy processor load.
Actually JSP being transformed to servlet, and JspServlet forward incoming
request to it. JSP is not an interpriter. JSP page need to be compiled into
servlet each time its (JSP) source changes on disk if it's the first request
to a page. For your situation XML/XSL transformation is better solution.
Lookup at Xalan or Coccon project at xml.apache.org.

Regards,
Andrey

> -----Original Message-----
> From: L.Fernando [mailto:fernando@stts.com.br]
> Sent: Friday, August 10, 2001 1:39 AM
> To: tomcat-user@jakarta.apache.org
> Subject: How to execute a dynamic JSP from a Servlet WITHOUT
> sending it to disk first ?
>
>
> Hi All,
> I have the following problem:
>
> Based on some database data, one Servlet dynamicly generates an JSP page
> text inside an string buffer.
>
> The question is:
>
> How to execute that "page" without having to write it to disk before
> dispatching it ? I mean, how to send that string buffer (with my "page"
> inside it) directly to the jsp interpreter servlet ?
>
> Any help will be welcome !
>
> Thanks in advance,
>
> Fernando.
>
>
>
>


Re: How to execute a dynamic JSP from a Servlet WITHOUT sending it to disk first ?

Posted by "L.Fernando" <fe...@stts.com.br>.
That´s a good aproach....
Thanks for your help, Jim.

Fernando.

----- Original Message -----
From: "Jim Seach" <jw...@yahoo.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, August 09, 2001 8:23 PM
Subject: Re: How to execute a dynamic JSP from a Servlet WITHOUT sending it
to disk first ?


> Fernando,
>
> Why do you need to create the JSP page itself dynamically?  Couldn't
> you just create one or several JSP pages, then in your servlet, get the
> data, put it into request attributes, and call the proper JSP page to
> display the data?  The JSP page would then take the data from the
> request attributes and display what is needed.
>
> Hope this helps,
>
> Jim
>
> --- "L.Fernando" <fe...@stts.com.br> wrote:
> > Hi All,
> > I have the following problem:
> >
> > Based on some database data, one Servlet dynamicly generates an JSP
> > page
> > text inside an string buffer.
> >
> > The question is:
> >
> > How to execute that "page" without having to write it to disk before
> > dispatching it ? I mean, how to send that string buffer (with my
> > "page"
> > inside it) directly to the jsp interpreter servlet ?
> >
> > Any help will be welcome !
> >
> > Thanks in advance,
> >
> > Fernando.
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>


Re: How to execute a dynamic JSP from a Servlet WITHOUT sending it to disk first ?

Posted by Jim Seach <jw...@yahoo.com>.
Fernando,

Why do you need to create the JSP page itself dynamically?  Couldn't
you just create one or several JSP pages, then in your servlet, get the
data, put it into request attributes, and call the proper JSP page to
display the data?  The JSP page would then take the data from the
request attributes and display what is needed.

Hope this helps,

Jim

--- "L.Fernando" <fe...@stts.com.br> wrote:
> Hi All,
> I have the following problem:
> 
> Based on some database data, one Servlet dynamicly generates an JSP
> page
> text inside an string buffer.
> 
> The question is:
> 
> How to execute that "page" without having to write it to disk before
> dispatching it ? I mean, how to send that string buffer (with my
> "page"
> inside it) directly to the jsp interpreter servlet ?
> 
> Any help will be welcome !
> 
> Thanks in advance,
> 
> Fernando.
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/