Hi.
I'm writing some jsp files to be the V part of an MVC design.
These jsp files all produce very similar looking output - they all
produce single column tables with exactly the same layout.
I would like to make all these classes extend a common base class, so
that I can keep all the shared stuff, like setting the colour for the
header row of the table etc. all in one place.
We're given <%@ page extends="parentClass" %>, but if we want to make
the parent class another jsp, is there a way?
How do I specify in my parent jsp which package it will be a part of, so
I know how to refer to it from the child class?
How can I let the jsp compiler know that the parent class needs to be
compiled first? javac won't be able to find the class file so will go
looking for a .java file, and won't know anything about the .jsp.
Is this all just too much to ask, and should I just write a helper class
to do the formatting? I could instantiate it in the main page and store
it in the session, so all the other classes use it for doing formatting
stuff, leaving me with my formatting code in just one place.
Also I'm including many of these different views in one big table. If I
want to make each view a seperate class, I have to include them with
<jsp:include> rather than <%@ include " %>. From what I understand this
is almost like making a whole new request on the web server. What is the
overhead of this, if I'm going to be doing it 10 times in a single page?
Perhaps we need a form of include which instantiates a new servlet/jsp
without going through the web server?
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".