tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Pelegri--Llopart <Eduardo.Pelegrillop...@eng.sun.com>
Subject Re: JSP Methods?
Date Tue, 25 Jul 2000 00:53:54 GMT
This cannot be done in JSP 1.1.  Variations of this request appear with
some frequency.  I cluster them into "JSP as tags" (although that is
more of a solution than a requirement) in that what you want is to take
a collection of tags (+ template text) and encapsulate it
(efficiently).  That requirement has been and it is being discussed in
the context of JSP 1.2.

	- eduard/o 

Martin Wells wrote:
> 
> Hi all,
> 
> I'd like to be able to output certain segments of HTML multiple times, in
> different cases.
> 
> The example below would be perfect, alas I think it's not supported by the
> JSP implementation (since a declaration is handled before the HTML pass).
> Correct me if I'm wrong please. :)
> 
> Example:
> 
> <%! void printHello()
>     { %>
>         <B>HELLO WORLD</B>
> <%! } %>
> 
> <HTML>
> <BODY>
>         I'm saying, <%= printHello() %>
> </BODY>
> </HTML>
> 
> Any ideas on achieving something like this?
> 
> ==============================================================
> _/_/  Martin J. Wells            http://www.tasman-studios.com
> _/  CTO, Tasman Studios        mailto:marty@tasman-studios.com
> ==============================================================

Mime
View raw message