S
Steve
Hi,
I hope this is the right newsgroup; it was the best I could find. If there
is a better one please direct me. Thanks.
OK, I'd like to know if there is a 'best practice' for managing the
following scenario:
I have a web-based project (in Eclipse) with some jsp files and in the best
tradition I have modularized them so the top level jsp has many
<jsp:include> tags to include other parts. Now, I am using stylesheets
extensively and I'm having problems working out the best way to get the
stylesheets included in the page.
Here's a (very simple) example to help:
page.jsp:
<html>
<head>
<link href="css/main.css" ... />
</head>
<body>
<jsp:include page="header.jsp" />
<jsp:include page="tabs.jsp" />
<jsp:include page="body.jsp" />
<jsp:include page="footer.jsp" />
</body>
</html>
tabs.jsp (for example) defines a <div> and a nested <ul>. Both use a style
class that I define in a stylesheet.
Obviously, whatever page tabs.jsp is included from (potentially many) needs
to link to that stylesheet. So - how do I link to it? Probably not so
difficult in this small example since I could add a <link> for the tabs
stylesheet.
It could get messy with many nested includes. And, potentially conditional
includes as well. How do I know beforehand (at the <head> tag) which styles
I will need? It would be nice if each .jsp segment could define the
stylesheet it needs and somehow get that magically transported back in time
to a <link> tag!
I've seen other sites compromise and have just one all-encompassing
stylesheet for everything. Is this the best way to go?
Thanks for any advice.
--
Regards,
Steve
"...which means he created the heaven and the earth... in the DARK! How good
is that?"
I hope this is the right newsgroup; it was the best I could find. If there
is a better one please direct me. Thanks.
OK, I'd like to know if there is a 'best practice' for managing the
following scenario:
I have a web-based project (in Eclipse) with some jsp files and in the best
tradition I have modularized them so the top level jsp has many
<jsp:include> tags to include other parts. Now, I am using stylesheets
extensively and I'm having problems working out the best way to get the
stylesheets included in the page.
Here's a (very simple) example to help:
page.jsp:
<html>
<head>
<link href="css/main.css" ... />
</head>
<body>
<jsp:include page="header.jsp" />
<jsp:include page="tabs.jsp" />
<jsp:include page="body.jsp" />
<jsp:include page="footer.jsp" />
</body>
</html>
tabs.jsp (for example) defines a <div> and a nested <ul>. Both use a style
class that I define in a stylesheet.
Obviously, whatever page tabs.jsp is included from (potentially many) needs
to link to that stylesheet. So - how do I link to it? Probably not so
difficult in this small example since I could add a <link> for the tabs
stylesheet.
It could get messy with many nested includes. And, potentially conditional
includes as well. How do I know beforehand (at the <head> tag) which styles
I will need? It would be nice if each .jsp segment could define the
stylesheet it needs and somehow get that magically transported back in time
to a <link> tag!
I've seen other sites compromise and have just one all-encompassing
stylesheet for everything. Is this the best way to go?
Thanks for any advice.
--
Regards,
Steve
"...which means he created the heaven and the earth... in the DARK! How good
is that?"