On Thu, 9 Jan 2003, Rami Ojares wrote:

> Date: Thu, 9 Jan 2003 12:06:16 +0200
> From: Rami Ojares <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Evaluating jsp inside java
>
> Hi
>
> I am building tag <reevaluate> which takes it's
> bodycontent and evaluates it as jsp.
>
> Ex.
> <reevaluate>
>     <getSomeDataThatHappensToBeArbitratyJSPWithTagsAndAll />
> </reevaluate>
>
> So in doEndTag() I get the body content and would like to have a method
> like this
>
> String Jasper.evaluate(String arbitraryJsp, ServletContext sameContext)
>
> Because I could not decipher Jasper's logic well enough I tried also
> writing body content to temporary file and then including that jsp file
> with RequestDispatcher. But that also gives me error that getOutputStream has 
>already been
> called.
>
> I even tried to implement my own HttpServletResponse that just stores in StringBuffer
> everything that is written to it but that gives some obscure errors too.
>
> Any ideas/knowledge?
>

Just a suggestion ... give up on this approach.

If you're going to all the effort to generate something, you might as well
just generate the final HTML directly.  Trying to generate JSP code on the
fly, then compile and execute it, is just going to eat performance for no
good reason.

> - rami

Craig




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to