<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fforw.de &#187; JSP</title>
	<atom:link href="http://fforw.de/tag/jsp/feed/" rel="self" type="application/rss+xml" />
	<link>http://fforw.de</link>
	<description>skip the boring parts</description>
	<lastBuildDate>Sat, 12 Nov 2011 11:54:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Hood Beta 2</title>
		<link>http://fforw.de/post/hood-beta-2/</link>
		<comments>http://fforw.de/post/hood-beta-2/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 14:51:19 +0000</pubDate>
		<dc:creator>fforw</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[hood]]></category>
		<category><![CDATA[jcouchdb]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://fforw.de/?p=97</guid>
		<description><![CDATA[After fixing a pretty serious bug in the combination of svenson and jcouchdb and releasing svenson 1.3.4 and jcouchdb 0.9.1-4 and jcouchdb 0.10.0-2, I got around to release a new, improved version of Hood, too. It&#8217;s called &#8220;Beta 2&#8243; and still lacks some features but the documentation is a lot better and the application design [...]]]></description>
			<content:encoded><![CDATA[<p>After fixing a pretty serious bug in the combination of svenson and jcouchdb and releasing <em>svenson 1.3.4</em> and <em>jcouchdb 0.9.1-4 </em>and <em>jcouchdb 0.10.0-2</em>, I got around to release a new, improved version of Hood, too. It&#8217;s called &#8220;Beta 2&#8243; and still lacks some features but the documentation is a lot better and the application design is basically what I think will be the final layout of things.</p>
<p>Head over to google code and grab yourself a copy.</p>
<p><strong>Links:</strong></p>
<ul>
<li><a title="Hood Beta 2 at google code" href="http://jcouchdb.googlecode.com/files/hood-beta-2.zip">Hood Beta 2</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fforw.de/post/hood-beta-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hood: example application for jcouchdb 0.10.0-1</title>
		<link>http://fforw.de/post/hood-example-application-for-jcouchdb-0-10-0-1/</link>
		<comments>http://fforw.de/post/hood-example-application-for-jcouchdb-0-10-0-1/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 22:52:22 +0000</pubDate>
		<dc:creator>fforw</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jcouchdb]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[svenson]]></category>

		<guid isPermaLink="false">http://fforw.de/?p=92</guid>
		<description><![CDATA[On the occasion of presenting CouchDB and jcouchdb at my place of work, I got around to finally create a small example application that is now downloadable as sneak preview. There need to be bugs fixed, features implemented and lots of documentation to be added, but it kind of works. It&#8217;s called &#8220;Hood&#8221; for neighbourhood [...]]]></description>
			<content:encoded><![CDATA[<p>On the occasion of presenting CouchDB and jcouchdb at my place of work, I got around to finally create a small example application that is now downloadable as sneak preview. There need to be bugs fixed, features implemented and lots of documentation to be added, but it kind of works.</p>
<p>It&#8217;s called &#8220;Hood&#8221; for neighbourhood and allows you to mark places or people around a place of activity of yours, called hood. it is meant to foster collaboration / tips on local places etc.</p>
<p>It&#8217;s Spring Web Application demonstrating some techniques of working with jcouchdb. It&#8217;s an eclipse WTP/Spring IDE project with all dependencies you need besides couchdb and tomcat or another servlet container.</p>
<p>Stay tuned for hood to grow into a fullblown app.</p>
<p><strong>Links:</strong></p>
<ul>
<li><span style="text-decoration: line-through;">Hood Alpha &#8211; download at code.google.com</span></li>
<li><a href="http://jcouchdb.googlecode.com/files/hood-beta-2.zip">Hood Beta 2 &#8211; download at code.google.com</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fforw.de/post/hood-example-application-for-jcouchdb-0-10-0-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating JSP Layouts with Page Tags</title>
		<link>http://fforw.de/post/creating-jsp-layouts-with-page-tags/</link>
		<comments>http://fforw.de/post/creating-jsp-layouts-with-page-tags/#comments</comments>
		<pubDate>Sat, 03 Mar 2007 21:17:02 +0000</pubDate>
		<dc:creator>fforw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://blog.willie/?p=16</guid>
		<description><![CDATA[For some time now I&#8217;ve been following a new approach when creating the basic layout structure for JSP based web applications. The new approach is based on JSP 2.0 tag files and changes the way that the single pages are build up from reusable parts. The most common way to do so is to use [...]]]></description>
			<content:encoded><![CDATA[<p>For some time now I&#8217;ve been following a new approach when creating the basic layout structure for JSP based web applications. The new approach is based on <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags5.html">JSP 2.0 tag files</a> and changes the way that the single pages are build up from reusable parts.</p>
<hr width="100%" size="2" />
<p>The most common way to do so is to use included files with common blocks:</p>
<blockquote><p> &lt;%@include &#8220;head.inc&#8221;%> </p>
<p>&lt;b>page specific markup&lt;/b> </p>
<p> &lt;%@include &#8220;tail.inc&#8221;%></p></blockquote>
<p> Here the individual pages contain two or more includes which define the page start and end. Often navigation or sidebars or whatever are included in their own files. Changing the output of the title in the header e.g. requires passing data through the page scope or so.</p>
<p>My new approach defines the basic layout as <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags5.html">JSP 2.0 tag file</a>. Let&#8217;s take a look at an example: </p>
<blockquote><p><strong>&lt;%@tag description=&#8221;page layout&#8221; %><br />&lt;%@taglib prefix=&#8221;c&#8221; uri=&#8221;http://java.sun.com/jsp/jstl/core&#8221;%><br />&lt;%@attribute name=&#8221;head&#8221; fragment=&#8221;true&#8221;%><br />&lt;%@attribute name=&#8221;title&#8221; required=&#8221;true&#8221; type=&#8221;java.lang.String&#8221;%><br />&lt;%@attribute name=&#8221;script&#8221; required=&#8221;false&#8221; type=&#8221;java.lang.String&#8221;%><br />&lt;%@attribute name=&#8221;stylesheet&#8221; required=&#8221;false&#8221; type=&#8221;java.lang.String&#8221;%></strong><br />&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/html4/loose.dtd&#8221;><br />&lt;html><br />&lt;head><br />&lt;title>${title} &#8211; Page Tag Example&lt;/title><br />&lt;style type=&#8221;text/css&#8221;><br />    @import url(&#8220;<strong>&lt;c:url value=&#8221;/style/style.css&#8221;/></strong>&#8220;);<br /><strong>    &lt;c:forTokens var=&#8221;item&#8221; items=&#8221;${stylesheet}&#8221; delims=&#8221;,&#8221;></strong><br />    @import url(&#8220;<strong>&lt;c:url value=&#8221;/style/&#8221;/>${item}</strong>&#8220;);<br /><strong>    &lt;/c:forTokens>    </strong><br />&lt;/style></p>
<p><strong>&lt;c:forTokens var=&#8221;item&#8221; items=&#8221;${script}&#8221; delims=&#8221;,&#8221;></strong><br />&lt;script type=&#8221;text/javascript&#8221; src=&#8221;<strong>&lt;c:url value=&#8221;/script/&#8221;/>${item}</strong>&#8220;><br />&lt;/script><br /><strong>&lt;/c:forTokens>    </strong><br /><em><strong>&lt;jsp:invoke fragment=&#8221;head&#8221; /></strong></em><br />&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=UTF-8&#8243;><br />&lt;meta http-equiv=&#8221;Pragma&#8221; content=&#8221;no-cache&#8221;><br />&lt;/head><br />&lt;body><br />&lt;h1>Page Tag Example&lt;/h1><br />&lt;ul id=&#8221;nav&#8221;><br />  &lt;li>&lt;a href=&#8221;index.jsp&#8221;>Index&lt;/a>&lt;/li><br />  &lt;li>&lt;a href=&#8221;page1.jsp&#8221;>Page 1&lt;/a>&lt;/li><br />  &lt;li>&lt;a href=&#8221;page2.jsp&#8221;>Page 2&lt;/a>&lt;/li><br />&lt;/ul><br />&lt;div id=&#8221;content&#8221;><br /><em><strong>&lt;jsp:doBody /></strong></em><br />&lt;/div><br />  &lt;hr><br />  &lt;div id=&#8221;footer&#8221;><br />    &lt;a href=&#8221;http://validator.w3.org/check?uri=referer&#8221;>&lt;img<br />        src=&#8221;http://www.w3.org/Icons/valid-html401&#8243; border=&#8221;0&#8243;<br />        alt=&#8221;Valid HTML 4.01 Transitional&#8221; height=&#8221;31&#8243; width=&#8221;8&#8243;>&lt;/a><br />  &lt;/div><br />  &lt;/body><br />&lt;/html></p></blockquote>
<p>The tag defines the example page layout with a page header, a navigation and a footer. There are several attributes to control the page tag from inside the JSP page it is used in:</p>
<ul>
<li><em>head</em> &#8211; Fragment attribute used to add additional HTML markup to the head section of the page </li>
<li><em>title</em> &#8211; Required attribute which sets the page specific part of the page title</li>
<li><em>script</em> &#8211; Comma separated lists of script files to include from the /script directory</li>
<li><em>stylesheet</em> &#8211; Comma separated lists of style sheets to import from the /style directory</li>
</ul>
<p>The head fragment attribute demonstrates how to setup a <a href="http://java.sun.com/products/jsp/syntax/2.0/syntaxref208.html#997991">fragment attribute</a> which makes it possible to set HTML code as an attribute. To use such a fragment attribute inside a page you need to use the &lt;jsp:attribute> and &lt;jsp:body> tags:</p>
<blockquote><p>&lt;%@taglib tagdir=&#8221;/WEB-INF/tags&#8221; prefix=&#8221;example&#8221;%><br />&lt;example:page title=&#8221;Page 1&#8243;><br />&lt;jsp:attribute name=&#8221;head&#8221;><br />&lt;meta name=&#8221;author&#8221; content=&#8221;Sven Helmberger&#8221;><br />&lt;/jsp:attribute><br />&lt;jsp:body><br />Page 1 &#8211; demonstrates the use of the head fragment attribute<br />&lt;/jsp:body><br />&lt;/example:page></p></blockquote>
<p>If you only use normal (non-fragment) attributes you can leave out the &lt;jsp:attribute> and &lt;jsp:body> tags and specify the rest of the attributes like the title attribute above. Fragment attributes can also be useful to define common code blocks besides the tag body like a page-specific area in a sidebar or so.  </p>
<p>You can see that, even with fragment attributes complicating things, the page tag leads to a simple JSP code with high reuse and clear passing of data from the special page code to the common code.</p>
<ul>
<li><a href="/static/files/pagetag-webapp.zip" title="Source code for this blog entry">Download the pagetag example webapp</a>  </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fforw.de/post/creating-jsp-layouts-with-page-tags/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

