You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Krier <pk...@motive.com> on 2000/03/30 02:32:59 UTC
JSP Code Reuse
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