craigmcc 01/04/28 20:42:33
Modified: web/template-example chapterTemplate.jsp introduction.html
more.html optional.html using.html
Log:
Refactor page contents of the struts-template example so that redundant
<html>, <head>, and <body> tags are not generated. Many thanks to
<[EMAIL PROTECTED]> for identifying the required changes!
PR: Bugzilla #852
Submitted by: [EMAIL PROTECTED]
Revision Changes Path
1.4 +10 -3 jakarta-struts/web/template-example/chapterTemplate.jsp
Index: chapterTemplate.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/template-example/chapterTemplate.jsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- chapterTemplate.jsp 2001/04/29 01:39:11 1.3
+++ chapterTemplate.jsp 2001/04/29 03:42:32 1.4
@@ -1,10 +1,16 @@
<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>
-<html><head><title><template:get name='title'/></title></head>
+<html>
+<head>
+<title><template:get name='title'/></title>
+<link rel="stylesheet" href="css/templates.css"
+ charset="ISO-8859-1" type="text/css">
+</head>
<body background='graphics/blueAndWhiteBackground.gif'>
<table>
- <tr valign='top'><td><template:get name='sidebar'/></td>
+ <tr valign='top'>
+ <td><template:get name='sidebar'/></td>
<td><table>
<tr><td><template:get name='header'/></td></tr>
<tr><td><template:get name='content'/></td></tr>
@@ -13,7 +19,8 @@
</td>
</tr>
</table>
-</body></html>
+</body>
+</html>
<%
/*
1.4 +0 -7 jakarta-struts/web/template-example/introduction.html
Index: introduction.html
===================================================================
RCS file: /home/cvs/jakarta-struts/web/template-example/introduction.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- introduction.html 2001/01/12 01:50:49 1.3
+++ introduction.html 2001/04/29 03:42:32 1.4
@@ -1,8 +1,3 @@
-<html>
-<head>
-<link rel="stylesheet" href="css/templates.css" charset="ISO-8859-1"
type="text/css">
-</head>
-<body>
<p class="Paragraph"><i>This example application is based on <a
href="http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb_p.html">Using JSP
templates to encapsulate Webpage layout and encourage modular design</a> by David
Geary. Follow that link for the full article, which also covers using role-based and
nested templates. The template classes described in the Java World article were the
basis for those included with Struts 1.0.</i></p>
<h3 class="ChapTitle">Introduction</h3>
<p class="Paragraph">Window toolkits typically provide a layout mechanism that
positions widgets in a container; for example, AWT and Swing have layout managers,
whereas VisualWorks Smalltalk has wrappers.</p>
@@ -45,5 +40,3 @@
</table><br>
</body></html></p>
<p class="Paragraph">To minimize the impact of layout changes, a mechanism is
needed for dynamically including layout in addition to content. That way, both layout
and content can be changed without modifying files that use them. For large websites
that have many pages with identical formats, such a mechanism is valuable because it
localizes changes to layout. That mechanism is JSP templates.</p>
-</body>
-</html>
\ No newline at end of file
1.2 +0 -7 jakarta-struts/web/template-example/more.html
Index: more.html
===================================================================
RCS file: /home/cvs/jakarta-struts/web/template-example/more.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- more.html 2001/01/12 01:50:49 1.1
+++ more.html 2001/04/29 03:42:32 1.2
@@ -1,9 +1,2 @@
-<html>
-<head>
-<link rel="stylesheet" href="css/templates.css" charset="ISO-8859-1"
type="text/css">
-</head>
-<body>
<h3 class="ChapTitle">More About Templates</h3>
<p class="Paragraph">Visit <a
href="http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb_p.html">Using JSP
templates to encapsulate Webpage layout and encourage modular design</a> by David
Geary to learn more about JSP templates.</p>
-</body>
-</html>
1.4 +0 -7 jakarta-struts/web/template-example/optional.html
Index: optional.html
===================================================================
RCS file: /home/cvs/jakarta-struts/web/template-example/optional.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- optional.html 2001/01/12 01:50:49 1.3
+++ optional.html 2001/04/29 03:42:32 1.4
@@ -1,8 +1,3 @@
-<html>
-<head>
-<link rel="stylesheet" href="css/templates.css" charset="ISO-8859-1"
type="text/css">
-</head>
-<body>
<h3 class="ChapTitle">Optional Content</h3>
<p class="Paragraph">All template content is optional, which makes a single
template useful to more web pages. For example, in "Two Pages Created From One
Template" there are two pages--login and inventory--that use the same template.</p>
<p class="Paragraph">Both pages have a header, footer, and main content. The
inventory page has an edit panel, which the login page lacks, for making inventory
changes.</P></p>
@@ -43,5 +38,3 @@
<template:put name='footer' content='/footer.jsp'/><br>
</template:insert></p>
<p class="Paragraph">Because the login page does not specify content for it, the
edit panel is not included. Unspecified content is omitted because
the template:get tag only includes specified content.</p>
-</body>
-</html>
1.4 +0 -7 jakarta-struts/web/template-example/using.html
Index: using.html
===================================================================
RCS file: /home/cvs/jakarta-struts/web/template-example/using.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- using.html 2001/01/12 01:50:49 1.3
+++ using.html 2001/04/29 03:42:32 1.4
@@ -1,8 +1,3 @@
-<html>
-<head>
-<link rel="stylesheet" href="css/templates.css" charset="ISO-8859-1"
type="text/css">
-</head>
-<body>
<h3 class="ChapTitle">Using Templates</h3>
<p class="Paragraph">Templates are JSP files that include parameterized content;
for instance, A JSP Template (chapterTemplate.jsp) lists a template that can be used
to produce web pages with the format shown in A Web Page Layout.</p>
<h4 class="CodeCaption">A JSP Template (chapterTemplate.jsp)</h4>
@@ -44,5 +39,3 @@
<h4 class="Tip">JSP Tip - When To Use Templates</h4>
<p class="Paragraph">Templates provide a mechanism to encapsulate web page layout.
Because layout is specified in a single template and used for many web pages, the
impact of layout changes is reduced to the template itself.</p>
<p class="Paragraph">Because the main benefit of templates is reducing the impact
of layout changes, templates are most applicable to large websites that have many web
pages with identical formats.</p>
-</body>
-</html>
\ No newline at end of file