how to capture html

2001-09-24 Thread Brian K. Buckley

Is there a good way to capture the output from a snippet of jsp into a
String variable that can be reused multiple times in a page?

- Brian

As a simple example, if one needed to have the line:

Name

appear in several places, how can one set a String namerow so that the line
can be redisplayed by saying <%=namerow%> instead of repeating the whole
snippet?  Note that the snippet includes a custom tag.






Re: how to capture html

2001-09-24 Thread Ted Husted

You might want to try this one on the JSP list. The archives are also
quite extensive. 

http://archives.java.sun.com/archives/jsp-interest.html

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/


"Brian K. Buckley" wrote:
> 
> Is there a good way to capture the output from a snippet of jsp into a
> String variable that can be reused multiple times in a page?
> 
> - Brian
> 
> As a simple example, if one needed to have the line:
> 
> Name property='name'/>
> 
> appear in several places, how can one set a String namerow so that the line
> can be redisplayed by saying <%=namerow%> instead of repeating the whole
> snippet?  Note that the snippet includes a custom tag.



Re: how to capture html

2001-09-24 Thread Gregor Rayman

"Brian K. Buckley" <[EMAIL PROTECTED]> wrote:


> Is there a good way to capture the output from a snippet of jsp into a
> String variable that can be reused multiple times in a page?
> 
> - Brian
> 
> As a simple example, if one needed to have the line:
> 
> Name property='name'/>
> 
> appear in several places, how can one set a String namerow so that the line
> can be redisplayed by saying <%=namerow%> instead of repeating the whole
> snippet?  Note that the snippet includes a custom tag.

Not really. The only way I know, is to enclose the snippet into a method
with a variable called "out". HTML in JSP will be translated into

out.print("");


--
gR








Re: how to capture html

2001-09-24 Thread Matt Raible

<%
BodyContent bc = pageContext.pushBody();
%>
Name
<%
String namerow = bc.getString();
pageContext.popBody();
%>

Matt

--- "Brian K. Buckley" <[EMAIL PROTECTED]> wrote:
> Is there a good way to capture the output from a snippet of jsp into a
> String variable that can be reused multiple times in a page?
> 
> - Brian
> 
> As a simple example, if one needed to have the line:
> 
> Name property='name'/>
> 
> appear in several places, how can one set a String namerow so that the line
> can be redisplayed by saying <%=namerow%> instead of repeating the whole
> snippet?  Note that the snippet includes a custom tag.
> 
> 
> 


__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com



Re: how to capture html

2001-09-24 Thread John Raley

This might be useful:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14326.html

Brian K. Buckley wrote:

>Is there a good way to capture the output from a snippet of jsp into a
>String variable that can be reused multiple times in a page?
>
>- Brian
>
>As a simple example, if one needed to have the line:
>
>Nameproperty='name'/>
>
>appear in several places, how can one set a String namerow so that the line
>can be redisplayed by saying <%=namerow%> instead of repeating the whole
>snippet?  Note that the snippet includes a custom tag.
>
>
>