tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bruce <chrisabr...@yahoo.com>
Subject Re: JSP Code Reuse
Date Thu, 30 Mar 2000 00:41:47 GMT
Paul,

Despite what you said about tag libraries, I think they are your best
bet.  You can find some working examples at http://www.jsptags.com. 
You might also want to look at JSSI (java server side includes?).  You
could use the output of servlets for insertion into your pages. 
Lastly, if you created all of the functionality as beans, you could use
them.


Regards,

Chris Bruce


--- Paul Krier <pkrier@motive.com> wrote:
> Hello,
> 
> I am working on a design for an JSP Application.  I would like to be
> able to
> create a library of JSP code that could be reused reused in
> templates.  This
> would allow me to write a displayUserInfo block and call it from
> other
> templates isolating changes to display to one area.  I have worked up
> a
> prototype using <%@include where each code block is its own file, but
> there
> is no scoping with this solution so if I define a var called user in
> my
> template file and then redefine it in my "function" file I get a
> translation
> time error.  I have also looked at defining the methods using <%! but
> I do
> not have access to such things as out without passing it in and it
> requires
> an understanding of Java that would be beyond the capabilities of
> customers
> customizing out product.  I have also try some other off the wall
> ideas
> using tag libraries without success.  This seems like a real weak
> spot with
> the current spec.  Does any one have any other great ideas for
> addressing
> this issue that don't require modification to Tomcat's source or the
> JSP
> spec?
> 
> thanks
> 
> paul
> 

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Mime
View raw message