tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Evaluating jsp inside java
Date Thu, 09 Jan 2003 18:04:29 GMT


On Thu, 9 Jan 2003, Rami Ojares wrote:

> Date: Thu, 9 Jan 2003 12:06:16 +0200
> From: Rami Ojares <rami.ojares@legosoft.net>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message