<?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>WebProNews &#187; InterAction</title>
	<atom:link href="http://www.webpronews.com/tag/interaction/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webpronews.com</link>
	<description>Breaking News in Tech, Search, Social, &#38; Business</description>
	<lastBuildDate>Mon, 13 Feb 2012 04:32:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>B2B Buyers Engaged With Their Peers Through Social Media</title>
		<link>http://www.webpronews.com/b2b-buyers-engaged-with-their-peers-through-social-media-2009-02</link>
		<comments>http://www.webpronews.com/b2b-buyers-engaged-with-their-peers-through-social-media-2009-02#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:58:29 +0000</pubDate>
		<dc:creator>Jordan McCollum</dc:creator>
				<category><![CDATA[Social Media]]></category>
		<category><![CDATA[B2B]]></category>
		<category><![CDATA[Buyers]]></category>
		<category><![CDATA[InterAction]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=48790</guid>
		<description><![CDATA[<p>A new report from Forrester Research, outlined by <a set="yes" linkindex="31" href="http://blogs.forrester.com/groundswell/2009/02/new-research-b2.html">Groundswell</a>, takes a look at how B2B buyers interact with social media&#8212;and by and large, they&#8217;re more engaged than their average peers.</p>
<p>The report breaks down the use of social media by Social Technographic role by type of social media involvement (types <a set="yes" linkindex="32" href="http://www.forrester.com/Groundswell/ladder.html">explained in this PPT</a>):</p>]]></description>
			<content:encoded><![CDATA[<p>A new report from Forrester Research, outlined by <a set="yes" linkindex="31" href="http://blogs.forrester.com/groundswell/2009/02/new-research-b2.html">Groundswell</a>, takes a look at how B2B buyers interact with social media&mdash;and by and large, they&rsquo;re more engaged than their average peers.</p>
<p>The report breaks down the use of social media by Social Technographic role by type of social media involvement (types <a set="yes" linkindex="32" href="http://www.forrester.com/Groundswell/ladder.html">explained in this PPT</a>):</p>
<p><a href="http://www.marketingpilgrim.com/wp-content/uploads/2009/02/forrester.gif"><img width="400" height="318" border="0" src="http://www.marketingpilgrim.com/wp-content/uploads/2009/02/forrester.gif" alt="forrester" title="forrester" class="alignnone size-full wp-image-8397" /></a></p>
<p>(Click To Enlarge)</p>
<p>
The &ldquo;Overall&rdquo; column indicates what percentage of those surveyed fell into that type of social media activity. Note that, obviously, there is overlap between roles&mdash;Creators, who generate online content, can also be Critics, who leave blog comments, etc.</p>
<p>Takeaways here:</p>
<ul>
<li><strong>91% of these decision-makers consume social media including blogs, video, and customer reviews</strong>.</li>
<li>69% of Spectators use social media for business purposes.</li>
<li>55% of the B2B buyers in this survey are Joiners&mdash;they&rsquo;ve created profiles on social networks.</li>
<li>After Spectators, the most popular role is Critics (again, people who leave comments on blogs, review products, etc.), with 58% of those sampled engaging in this activity, and 37% using it for business purposes.</li>
<li>Other than the Inactives, B2B buyers in IT fields were more engaged in social media&mdash;but the gap between IT buyers and non-IT buyers is narrowing.</li>
<li>43% are creating media, including blogs and videos.</li>
</ul>
<p>The report also made some recommendations and general observations, including:</p>
<ul>
<li>Buyers use social technology but don&rsquo;t rate it highly in terms of its influence on their buying decisions, despite the fact that they count on peers&rsquo; opinions to make decisions.</li>
<li>Social applications should be integrated into other marketing. For example, <a linkindex="33" href="http://zone.ni.com/devzone/cda/tut/p/id/5053">National Instruments</a> makes technical content from its customer community central in its marketing activity&mdash;this is a model other B2B sellers should follow.</li>
<li>Reach out to people by role&mdash;people with the same job description form natural communities.</li>
</ul>
<p>What other applications can we see from this information?</p>
<p><a href="http://www.marketingpilgrim.com/2009/02/b2b-buyers-dig-social-media.html">Comments</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/b2b-buyers-engaged-with-their-peers-through-social-media-2009-02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LexisNexis Unveils New Version Of CRM Product</title>
		<link>http://www.webpronews.com/lexisnexis-unveils-new-version-of-crm-product-2006-06</link>
		<comments>http://www.webpronews.com/lexisnexis-unveils-new-version-of-crm-product-2006-06#comments</comments>
		<pubDate>Mon, 05 Jun 2006 19:28:09 +0000</pubDate>
		<dc:creator>Doug Caverly</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[InterAction]]></category>
		<category><![CDATA[Product]]></category>
		<category><![CDATA[WebProNews]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=29688</guid>
		<description><![CDATA[LexisNexis Interface Software has revealed their latest CRM software in the form of InterAction 5.5.  It should feature improved document linking, internalization, calendar synchronization, and report writing as compared to previous versions.
]]></description>
			<content:encoded><![CDATA[<p>LexisNexis Interface Software has revealed their latest CRM software in the form of InterAction 5.5.  It should feature improved document linking, internalization, calendar synchronization, and report writing as compared to previous versions.</p>
<p>&#8220;InterAction5.5 provides more ways to collect information, more ways to distribute that information to professionals, marketing and business development teams, and more ways to leverage Relationship Intelligence internationally,&#8221; said John McDonnell, vice president and general manager of LexisNexis InterAction.  &#8220;We&#8217;ve built upon the rock-solid InterAction platform and expanded its capabilities . . .&#8221;</p>
<p>One of the most touted features of <a href="http://www.interfacesoftware.com/products/interaction/ia_summary.cfm" class="bluelink">InterAction 5.5</a> is its ability to generate a large variety of reports.  These include Who Knows Whom, Win/Loss Analysis on Opportunities, Marketing Event Analysis, and Customized Overview Reports.  Reports can also be created in Microsoft Reporting Services, Crystal Reports and common file formats including Microsoft Access (.mdb), Microsoft Excel (.xls) and Extended Markup Language (.xml).</p>
<p>Gregory Trinh, Director of Marketing Technology at Pillsbury Winthrop Shaw Pittman LLP, seemed pleased with these advances.  &#8220;InterAction&#8217;s new reporting facility will significantly enhance our ability to respond quickly to professionals&#8217; information requests by enabling us to aggregate and deliver internal and external information.&#8221;</p>
<p>InterAction is intended to work in a wide variety of settings and countries, as it supports Unicode data, which will allow for the integration of contact information in any language or character set.  Additionally, &#8220;InterAction 5.5&#8242;s internationalization and global mailing support will greatly enhance our ability to effectively communicate with clients and market to prospects worldwide,&#8221; said Sunny Bane, marketing CRM manager at DLA Piper Rudnick Gray Cary US LLP.</p>
<p>Synchronization with the Microsoft Outlook is another feature of the software, as is the ability to securely link with almost any type of document.  This latest version of InterAction should be a useful upgrade for followers of the product.</p>
<p>&#8220;The breadth, depth and quality of this new release demonstrates LexisNexis&#8217; commitment to the InterAction platform and to ensuring that it continues to raise the bar by which all professional services <a href="http://www.webpronews.com/expertarticles/expertarticles/wpn-62-20060601TopTipsForCRM.html" class="bluelink">CRM solutions</a> are judged,&#8221; said McDonnell.</p>
<p>Add to <script language='javascript'> document.write("<a href='http://del.icio.us/post?url="+encodeURIComponent(document.location.href)+"&#038;title="+encodeURIComponent(document.title)+"'>Del.icio.us</a>")</script> | <a href="javascript:void window.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)">DiggThis</a>  | <a href="javascript:void window.open('http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+encodeURIComponent(document.title)+'&#038;u='+encodeURIComponent(window.location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)">Yahoo! My Web</a></p>
<p>Technorati: </p>
<p>Doug is a staff writer for <a href="http://www.webpronews.com">WebProNews</a>. Visit <a href="http://www.webpronews.com">WebProNews</a> for the latest eBusiness news. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/lexisnexis-unveils-new-version-of-crm-product-2006-06/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>McKinsey on Tacit Interactions</title>
		<link>http://www.webpronews.com/mckinsey-on-tacit-interactions-2006-04</link>
		<comments>http://www.webpronews.com/mckinsey-on-tacit-interactions-2006-04#comments</comments>
		<pubDate>Tue, 04 Apr 2006 13:48:19 +0000</pubDate>
		<dc:creator>Ross Mayfield</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[InterAction]]></category>
		<category><![CDATA[Tacit interactions]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=28221</guid>
		<description><![CDATA[Vanessa Colella from McKinsey &#038; Company expands upon the two studies released today and their new notion of <a href="http://ross.typepad.com/blog/2006/04/software_2006.html" class="bluelink">Tacit Interaction</a>.
]]></description>
			<content:encoded><![CDATA[<p>Vanessa Colella from McKinsey &#038; Company expands upon the two studies released today and their new notion of <a href="http://ross.typepad.com/blog/2006/04/software_2006.html" class="bluelink">Tacit Interaction</a>.</p>
<li>Old formula was: customer need X offering innovation X sales and delivery models = success </li>
<li>New formula: automating tacit interactions X web 2.0 for the enteprise X software as a service = success</li>
<p>Tacit interactions require judgement or expertise, not entirely rules based.  Using IT to support tacit interations was more difficult before.  More difficult to automate because users are trying to do something different every time.  In the next phase of software they think it is possible.</p>
<p>Four categories of opportunity:</p>
<p>1. Timely access to information and context: Increases access to data and information at the right time in the right context for decision makers </p>
<p>2. Improved decision making: Supports decision making through tools that allow a better use of data and the presentation of relevant information </p>
<p>3. Enchanced communication: Enhances and expands the reach of communications and increases the richness of the message </p>
<p>4. Better collaboration: Enables and improves collaboration by facilitating transfer, sharing and simultaneous process of information</p>
<p>General apps and back office applications are moving to SaaS, Infrastructure and Tools are not.</p>
<p>On Tacit Interaction, this has been a constant thread of this blog and something John Seely Brown has been expanding upon for some time using different language (social fabric as 5% of IT spending, focus on exceptions. etc.). </p>
<p>Add to <script language='javascript'> document.write("<a   href='http://del.icio.us/post?url="+encodeURIComponent(document.location.href)+"&#038;title="+encodeURIComponent(document.title)+"  '>Del.icio.us</a>")</script> | <a href="javascript:void   window.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.location.href)+'&#038;ei=UTF-8','popup','width=520px,h  eight=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)">Digg</a>  | <a href="javascript:void   window.open('http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+encodeURIComponent(document.title)+'&#038;u='+encodeURICompo  nent(window.location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=10  0,top=50',0)">Yahoo! My Web</a></p>
<p>Technorati: </p>
<p><a name="ross"></a><a href="http://ross.typepad.com/">Ross Mayfield</a> is CEO and co-founder of <a href="http://www.socialtext.com/">Socialtext</a>, an emerging provider of Enterprise Social Software that dramatically increases group productivity and develops a group memory.
<p>He also writes <a href="http://ross.typepad.com/">Ross Mayfield&#8217;s Weblog</a> which focuses on markets, technology and musings. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/mckinsey-on-tacit-interactions-2006-04/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogs are about interaction and influence</title>
		<link>http://www.webpronews.com/blogs-are-about-interaction-and-influence-2005-06</link>
		<comments>http://www.webpronews.com/blogs-are-about-interaction-and-influence-2005-06#comments</comments>
		<pubDate>Mon, 27 Jun 2005 22:26:37 +0000</pubDate>
		<dc:creator>Neville Hobson</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Blogs]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[Crayon]]></category>
		<category><![CDATA[Independent]]></category>
		<category><![CDATA[InterAction]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Newspaper]]></category>
		<category><![CDATA[Reader]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=20210</guid>
		<description><![CDATA[Great article in The Independent newspaper yesterday about blogs and the business benefits by James Cherkoff, the advocate for open source marketing.
]]></description>
			<content:encoded><![CDATA[<p>Great article in The Independent newspaper yesterday about blogs and the business benefits by James Cherkoff, the advocate for open source marketing.</p>
<p>It&#8217;s a good overview of what&#8217;s happening and makes the case well. None of it will be news to anyone in the business blogging community, but will be a great starting point for those who aren&#8217;t (ie, the paper&#8217;s general readership).</p>
<p>Key message:</p>
<p>[...] It&#8217;s the interaction between blogs that makes them so interesting and influential. A single blog can be akin to a ranting madman on the corner. However, when linked together into massive intertwining communities, they have the vibrancy and passion of a massive street market, with information, opinions and whispers exchanging hands at light speed. And it&#8217;s no longer confined to techy chats. Conversations about every conceivable subject take place. And as the quantity and quality of these conversations grows, so does the blogosphere&#8217;s influence beyond the internet, including the commercial sector.</p>
<p>Links:<br />
<a href="http://news.independent.co.uk/media/story.jsp?story=649982">The Independent newspaper</a><br />
<a href="http://www.collaboratemarketing.com/">James Cherkoff</a><br />
<a href="http://www.changethis.com/14.opensourcemktg">Open Source Marketing</a></p>
<p><a href="http://www.nevon.net/nevon/2005/06/blogs_are_about.html#comments">Reader Comments</a>&#8230;</p>
<p>Neville Hobson is the author of the popular <b><a href="http://www.nevillehobson.com/">NevilleHobson.com blog</a></b> which focuses on business communication and technology.
<p>Neville is currentlly the VP of New Marketing at <a href="http://www.crayonville.com/">Crayon</a>. Visit Neville Hobson&#8217;s blog: <b><a href="http://www.nevillehobson.com/">NevilleHobson.com</a></b>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/blogs-are-about-interaction-and-influence-2005-06/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 2 Best-Kept Secrets Of The Internet</title>
		<link>http://www.webpronews.com/the-bestkept-secrets-of-the-internet-2004-05</link>
		<comments>http://www.webpronews.com/the-bestkept-secrets-of-the-internet-2004-05#comments</comments>
		<pubDate>Tue, 04 May 2004 15:48:26 +0000</pubDate>
		<dc:creator>Mike Cheney </dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[InterAction]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Secret]]></category>
		<category><![CDATA[Secrets]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=9874</guid>
		<description><![CDATA[It's a difficult task creating a website that brings  you business. It's a full-time job where things seem  easy at first but as soon as you start to explore the  possibilities and appreciate the complexity of the task  at hand it can soon start taking up ever increasing  amounts of your time. There is a plethora of people  out there offering you conflicting advice and it's often  difficult to know what to focus on.
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a difficult task creating a website that brings  you business. It&#8217;s a full-time job where things seem  easy at first but as soon as you start to explore the  possibilities and appreciate the complexity of the task  at hand it can soon start taking up ever increasing  amounts of your time. There is a plethora of people  out there offering you conflicting advice and it&#8217;s often  difficult to know what to focus on.</p>
<p>This article cuts through all that and reveals to you the  two most important things you need to know about creating  a website that brings more profit to your business.. </p>
<h4> Secret Number 1 &#8211; Information</h4>
<p>Yes &#8211; that&#8217;s all it is &#8211; information. Just think about  this for a minute &#8211; what is the sole reason for anyone  surfing any website anywhere across the world? Every single  one of them is looking for just one thing &#8211; information.  The information might take the form of text, an image, a  sound file or whatever but at the end of the day it is  information. This is the first biggest and best-kept  secret of success on the internet and now you know it! </p>
<p>What do you mean &#8216;So what?&#8217;. The sole purpose of your  website is to provide its visitors with information &#8211;  think about this the next time some combat-trousered  graphic designer tells you a big Flash graphic would  be a good thing to have instead of a homepage.. People  are looking for information &#8211; don&#8217;t put anything in  the way of them getting this. Make sure the information  you have on your site is easy to find, worthwhile reading  and ideally easy for your visitors to disseminate onto  their friends and colleagues. </p>
<p>Information is also essential if you are going to gain  any influence with the search engines. They might only  be computer programs but those search engine critters  can be quite clever at discerning a website that  contains nothing of any use and one that has useful  information relevant to its target audience. Lots and  lots of high quality relevant content on your website  will do more for your website&#8217;s overall success than  a fancy graphic or rotating picture of your head on  the homepage. </p>
<h4> Secret Number 2 &#8211; Interaction</h4>
<p>Goto your website. Just look at it. Go through a few  pages. Imagine that you had hit &#8216;Print&#8217; on each of  those pages. Would the experience of reading the pages  in hardcopy be exactly the same as reading them on  the screen? If it would you don&#8217;t own a website &#8211; you  own an expensive brochure. Interaction is why the  internet was born &#8211; it is the one attribute and  opportunity that sets the medium apart from print  and anything else. Your website needs to be littered  with things that enable interaction between you and  your visitors. Feedback forms, downloads,  bookmarking tools, contact options, newsletters etc. </p>
<p>Information and interaction &#8211; together these are the  only things that matter when it comes to the internet.  Now go back, look at your site and appraise it  honestly in terms of how well it addresses each of  the two facets. Is it full of interactive features  that enable people to get closer to your business  and control their browsing experience? Does it provide  lots of valuable information that is easy to find?  Armed with these two secrets you can start to truly  harness the real power of the internet. Good luck!</p>
<p>You can get free access to lots more of my articles plus a FREE Special Report &#8220;How To Turn Your Website Into A Customer Magnet&#8221; worth a value of 47 ($85) here: http://www.magnet4web.com/website_services/?page=freeguide</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/the-bestkept-secrets-of-the-internet-2004-05/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taming your Tomcat: Filtering tricks for Tomcat 5</title>
		<link>http://www.webpronews.com/taming-your-tomcat-filtering-tricks-for-tomcat-2003-03</link>
		<comments>http://www.webpronews.com/taming-your-tomcat-filtering-tricks-for-tomcat-2003-03#comments</comments>
		<pubDate>Thu, 27 Mar 2003 16:41:28 +0000</pubDate>
		<dc:creator>Sing Li</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[24]]></category>
		<category><![CDATA[3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Filtering]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[InterAction]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=3315</guid>
		<description><![CDATA[Designing maintainable high-performance systems

The new Tomcat 5 server takes filters to a new level of deployment flexibility. Tomcat 5's support for the upcoming Servlet 2.4 and JSP 2.0 specifications gives filter writers a new way to integrate and deploy these flexible components -- tapping directly into the request dispatcher's operations. In this article, Sing Li takes you on a guided tour of the new enhancement and gives you some hands-on training. See how Tomcat 5 can benefit Web application frameworks and lead ultimately to the design of maintainable high-performance systems.
]]></description>
			<content:encoded><![CDATA[<p>Designing maintainable high-performance systems</p>
<p>The new Tomcat 5 server takes filters to a new level of deployment flexibility. Tomcat 5&#8242;s support for the upcoming Servlet 2.4 and JSP 2.0 specifications gives filter writers a new way to integrate and deploy these flexible components &#8212; tapping directly into the request dispatcher&#8217;s operations. In this article, Sing Li takes you on a guided tour of the new enhancement and gives you some hands-on training. See how Tomcat 5 can benefit Web application frameworks and lead ultimately to the design of maintainable high-performance systems.</p>
<p>Back in June 2001, I wrote an article that previewed the (then) brand-new Servlet 2.3 feature called <i>filtering</i> (see <a href="#resources">Resources</a>). The Tomcat 4.x server supported this feature, and filters enabled Web application developers to create flexible application components that could be inserted and chained into the application server&#8217;s request flow &#8212; before and after the actual request was processed. And because filters are packaged as application-level components, on a par with JSP pages and servlets, they can easily be bundled in the same WAR file for deployment on any Servlet 2.3-compliant server. Since then, major application server vendors have embraced the Servlet 2.3 standard to support filtering, and filters have become a cornerstone component of many Web applications.</p>
<p>Readers who are unfamiliar with filtering operations &#8212; or who would like a refresher on how to construct filters and how filters work &#8212; are encouraged to read the <a href="http://www-106.ibm.com/developerworks/java/library/j-tomcat/">first Tomcat filtering article</a>.</p>
<p><b>Servlet 2.4 filter enhancements</b></p>
<p>Based on actual &#8220;in-the-field&#8221; feedback from the Web development community, the Servlet 2.4 specification &#8212; now being finalized &#8212; gives filters a single, highly important new capability. This new capability finally enables filters to play on completely level ground with servlets and JSP pages, enabling Web application designers to add major application functionality using filters. This new capability also facilitates a highly popular new style of Web application design called <i>JSP Model 2</i>, or <i>Model View Controller</i> (MVC) Web application design. (See <a href="#resources">Resources</a> for more information on JSP Model 2 or MVC-styled Web application design.)</p>
<p><b>Filters in the request dispatcher&#8217;s processing flow</b></p>
<p>The new filtering feature in Servlet 2.4 basically alleviates the restriction that filters can only operate in the request flow <i>before</i> and <i>after</i> the actual request processing by the application server. Instead, Servlet 2.4 filters can now interact with the request dispatcher at every dispatch point. This means that when a Web resource forwards a request to another resource (for instance, a servlet forwarding the request to a JSP page in the same application), a filter can be operating before the request is handled by the targeted resource. It also means that should a Web resource include the output or function from other Web resources (for instance, a JSP page including the output from multiple other JSP pages), Servlet 2.4 filters can work before and after each of the included resources. Figure 1 illustrates the difference between Servlet 2.3 and Servlet 2.4&#8242;s dispatcher interactions.</p>
<p><b>Figure 1. Servlet 2.3 and Servlet 2.4 filter differences</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig1.gif" width="462" height="382" alt="Servlet 2.3 and Servlet 2.4 Filter Differences"></p>
<p><b>Controlling filter dispatcher interactions</b></p>
<p>The interaction of filters with the container&#8217;s request processing flow is configured through the <code><filters-mapping></code> element definition in the deployment descriptor (web.xml file). This is the convention established in the Servlet 2.3 specification, and it has not changed in Servlet 2.4. Instead, the new ability to interact with the dispatcher is controlled through a new optional <code><dispatcher></code> sub-element. Listing 1 shows a <code><filters-mapping></code> element in a deployment descriptor that uses the <code><dispatcher></code> sub-element to apply a filter called &#8220;Blue Filter&#8221; to any JSP page that may be included (assuming that all the JSP pages in the application are mapped to the <code>/jsp/*</code> URL pattern):</p>
<p><a name="IDAUEESD"><b>Listing 1. Servlet 2.4-styled filter mapping</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
           <filter-name>Blue Filter</filter-name>
           <url-pattern>/jsp/*</url-pattern>
           <dispatcher>INCLUDE</dispatcher>
 </filter-mapping>
</code></pre>
</td>
</tr>
</table>
<p>
To apply the same filter to dispatcher-forwarded resources as well as included resources, we simply add another <code><dispatcher></code> sub-element, as shown in Listing 2:</p>
<p><a name="IDADFESD"><b>Listing 2. Mapping forwards and includes</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
           <filter-name>Blue Filter</filter-name>
           <url-pattern>/jsp/*</url-pattern>
           <dispatcher>INCLUDE</dispatcher>
           <dispatcher>FORWARD</dispatcher>
 </filter-mapping>
</code></pre>
</td>
</tr>
</table>
<p>The values that a <code><dispatcher></code> sub-element can contain are shown in Table 1:</p>
<p><b>Table 1. Possible values for a <dispatcher> sub-element</b></p>
<table width="100%" cellspacing="0" cellpadding="3" border="1">
<tr>
<th align="left" valign="top">Value</th>
<th align="left" valign="top">Description</th>
</tr>
<tr>
<td align="left" valign="top">REQUEST</td>
<td align="left" valign="top">Apply filter to request originating from the client &#8212; exactly the same as the default behavior in Servlet 2.3-compliant containers.</td>
</tr>
<tr>
<td align="left" valign="top">FORWARD</td>
<td align="left" valign="top">Apply filter to request as it is being forwarded using the <code type="inline">Dispatcher.forward()</code> call between Web resources.</td>
</tr>
<tr>
<td align="left" valign="top">INCLUDE</td>
<td align="left" valign="top">Apply filter to request as Web resources are being included through <code type="inline">Dispatcher.include()</code> calls.</td>
</tr>
<tr>
<td align="left" valign="top">ERROR</td>
<td align="left" valign="top">Apply filter to an error processing resource (essentially a container-managed forward mechanism when an error occurs).</td>
</tr>
</table>
<p>All of the values in Table 1, of course, are still subjected to the match specified by the <code><url-pattern></code> sub-element of <code><filter-mapping></code>. Essentially, only the URLs that match the <code><url-pattern></code><i>and</i> the <code><dispatcher></code> sub-element will be filtered.</p>
<p>To better appreciate the operation of the new filter/dispatcher interactions, let&#8217;s put some filters to work in a Tomcat server.</p>
<table width="40%" cellpadding="5" cellspacing="0" border="1" align="right">
<tr>
<td><a name="IDALGESD"><b>Downloading and installing Tomcat 5 plus JSTL</b></a><br />
All code has been fully tested under Tomcat 5.0 alpha, the latest release build available at the time this article was written. In addition to installing Tomcat, you need to download the JSTL 1.0 binaries. Place standard.jar and jstl.jar into the webapps/dvworks/web-inf/lib directory, and all the TLD files under the webapps/dvworks/web-inf directory. (See <a href="#resources">Resources</a>) for more information on installing Tomcat and downloading the JSTL 1.0 binaries.)</td>
</tr>
</table>
<p><b>Configuring Tomcat 5 filters</b></p>
<p>Assuming you have Tomcat 5 installed and running with the JSP Standard Tag Library 1.0 (see the sidebar &#8220;Downloading and installing Tomcat 5 plus JSTL&#8221;), we can now work with some actual filter examples. Download the <a href="ftp://www6.software.ibm.com/software/developer/library/j-tomcat2.zip">source code</a> to get our sample Web application.
</p>
<p>Let&#8217;s look at the coding of a couple of JSP pages and filters. The resources we&#8217;ll work with initially are:
</p>
<ul>
<li>/jsp/filtercount.jsp</li>
<li>/jsp/included.jsp</li>
<li>AddAttributesFilter</li>
<li>RedFilter</li>
</ul>
<p>The filtercount.jsp resource is quite simple, and consists of the code shown in Listing 3:</p>
<p><a name="IDANHESD"><b>Listing 3. Code for filtercount.jsp</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<H1>developerWorks Tomcat 5 Filters</H1>

<jsp:include page="/jsp/included.jsp">
  <jsp:param name="BoxColor" value="red"/>
</jsp:include>


<FONT FACE="verdana,arial,sans serif" SIZE="4">
<c:if test="${(requestScope.BlueCounter != null) &#038;&#038;
    (requestScope.BlueCounter > 0)}">
  <font color="blue">The BlueFilter has been activated
      ${requestScope.BlueCounter} times.</font></br>
</c:if>
<c:if test="${(requestScope.RedCounter != null) &#038;&#038;
    (requestScope.RedCounter > 0)}">
  <font color="red">The RedFilter has been activated
      ${requestScope.RedCounter} times.</font></br>
</c:if>
</FONT>
</BODY>
</HTML>

</code></pre>
</td>
</tr>
</table>
<p>This JSP page calls the dispatcher to include another JSP page called <code>/jsp/included.jsp</code>. It also uses the JSTL Expression Language to print out the value of two counters (<code>RedCounter</code> and <code>BlueCounter</code>) that are attached as attributes to the incoming request, if the counter exists, and if the count is greater than zero. </p>
<p>In fact, each counter is used to count the number of times that either <code>RedCounter</code> or <code>BlueCounter</code> is called during request processing. Table 2 shows the filters we will use and what they actually do.</p>
<p><b>Table 2. Names and functions of filters in experiment scenarios</b></p>
<table width="100%" cellspacing="0" cellpadding="3" border="1">
<tr valign="top">
<td><b>Filter Name</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td align="left" valign="top"><code type="inline">AddAttributesFilter</code></td>
<td align="left" valign="top">Add the <code type="inline">BlueCounter</code> and <code type="inline">RedCounter</code> attributes to the incoming request.</td>
</tr>
<tr>
<td align="left" valign="top"><code type="inline">RedFilter</code></td>
<td align="left" valign="top">Increment the value of the <code type="inline">RedCounter</code> attribute attached to the request.</td>
</tr>
<tr>
<td align="left" valign="top"><code type="inline">BlueFilter</code></td>
<td align="left" valign="top">Increment the value of the <code type="inline">BlueCounter</code> attribute attached to the request.</td>
</tr>
</table>
<p>All of the filters in Table 2 are part of the <code>com.ibm.dvworks.filters</code> package.</p>
<p>The code for <code>com.ibm.dvworks.filters.AddAttributesFilter</code> is presented in Listing 4. Note that it simply creates the two counter attributes as <code>java.lang.Integer</code> type, which has a value of 0.</p>
<p><b>Listing 4. Code for AddAttributesFilter.java</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
package com.ibm.devworks.filters;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public final class AddAttributesFilter implements Filter {

    public static final String RED_COUNTER_ATTRIB = "RedCounter";
    public static final String BLUE_COUNTER_ATTRIB = "BlueCounter";

    private FilterConfig filterConfig = null;

    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain)
	throws IOException, ServletException {

        request.setAttribute(RED_COUNTER_ATTRIB, new Integer(0));
        request.setAttribute(BLUE_COUNTER_ATTRIB, new Integer(0));
        filterConfig.getServletContext().log("Inside AddAttributesFilter");
        chain.doFilter(request, response);

    }

    public void destroy() {
        this.filterConfig = null;
    }

    public void init(FilterConfig filterConfig) {
	this.filterConfig = filterConfig;

    }

}

</code></pre>
</td>
</tr>
</table>
<p>The construction of this filter follows the basic filter coding pattern. Again, refer to the <a href="http://www-106.ibm.com/developerworks/java/library/j-tomcat/">first article</a> for  more details on coding filters.</p>
<p>Similarly, <code>com.ibm.dvworks.filters.RedFilter</code> has the code shown in Listing 5. Note that the code simply looks for the <code>RedCounter</code> attribute and increments it if found.</p>
<p><a name="IDA0ZESD"><b>Listing 5. Code for RedFilter.java</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
package com.ibm.devworks.filters;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public final class RedFilter implements Filter {

    public static final String COUNTER_ATTRIB = "RedCounter";
    private FilterConfig filterConfig = null;

    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain)
	throws IOException, ServletException {

    filterConfig.getServletContext().log("Inside RedFilter");
    Integer curCount = (Integer) request.getAttribute(COUNTER_ATTRIB);
    if (curCount != null)
        request.setAttribute(COUNTER_ATTRIB,
            new Integer(curCount.intValue() + 1));

      chain.doFilter(request, response);

    }

    public void destroy() {
        this.filterConfig = null;
    }

    public void init(FilterConfig filterConfig) {
	this.filterConfig = filterConfig;

    }

}
</code></pre>
</td>
</tr>
</table>
<p>The <code>com.ibm.dvworks.filters.BlueFilter</code> class has identical code to <code>RedFilter</code>, except the constant <code>COUNTER_ATTRIB</code> is defined to be <code>BlueFilter</code>, as shown in Listing 6:</p>
<p><a name="IDAV0ESD"><b>Listing 6. Code change for BlueFilter</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
public static final String COUNTER_ATTRIB = "BlueCounter";
</code></pre>
</td>
</tr>
</table>
<p>The filtercount.jsp file uses the dispatcher to include the included.jsp file. The included.jsp file simply creates a table that is filled with the color specified by the input parameter called <code>BoxColor</code>. Note the use of the Expression Language (EL) in rendering the color in the table, as shown in Listing 7:</p>
<p><a name="IDAE1ESD"><b>Listing 7. Code for included.jsp</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<table border="1" bgcolor="${param.BoxColor}" cellpadding="5">
<tr>
<td>this page is included in-line using dispatcher</td>
</tr>
</table>

</code></pre>
</td>
</tr>
</table>
<p>With these filters and JSP pages, we are ready to begin our exploration of five different filter configuration scenarios.</p>
<p><a name="IDAO1ESD"><span class="atitle3">Scenario 1: Standard Servlet 2.3 filter interaction &#8212; REQUEST only</span></a><br />
In this first scenario, we will configure our filters to work in a manner supported by older Servlet 2.3 containers.
</p>
<p>The <code><filter-mapping></code> element that we will use is shown in Listing 8:</p>
<p><a name="IDA31ESD"><b>Listing 8. Filter mapping for Standard Servlet 2.3 compatibility</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
  <filter-name>Add Attributes Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
</filter-mapping>
<filter-mapping>
  <filter-name>Red Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
</filter-mapping>
</code></pre>
</td>
</tr>
</table>
<p>Edit your web.xml to reflect the Listing 8 configuration. Here, we are not specifying a <code><dispatcher></code> sub-element. This means that the filters will be applied on a REQUEST-only basis, as it did in Servlet 2.3 containers. The configuration in Listing 8 is operationally identical to the code in Listing 9:</p>
<p><a name="IDAM2ESD"><b>Listing 9. Equivalent Servlet 2.4 filter mapping</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
  <filter-name>Add Attributes Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
  <filter-name>Red Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
</filter-mapping>
</code></pre>
</td>
</tr>
</table>
<p>Start Tomcat 5, and access the Web application using the <code>http://<hostname>:8080/dvworks/jsp/filtercount.jsp</code> URL. Figure 2 shows the response generated by filtercount.jsp:</p>
<p><a name="IDA02ESD"><b>Figure 2. Servlet 2.3-compatible REQUEST filtering </b></a><br /><img src="http://images.ientrymail.com/javapronews/fig2.gif" width="537" height="275" alt="Servlet 2.3 Compatible REQUEST Filtering"></p>
<p>According to the filtercount.jsp response, <code>RedFilter</code> has been called only once in this scenario. Figure 3 is a detailed interaction diagram showing the request flow through the request processors:</p>
<p><a name="IDAM3ESD"><b>Figure 3. Servlet 2.3 filtering request flow</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig3.gif" width="384" height="359" alt="Servlet 2.3 Filtering Request Flow"></p>
<p>In Figure 3, the filter chain is called only once &#8212; as the request enters the system from the client.<br />
The filter chain, of course, consists of <code>AddAttributesFilter</code> and <code>RedFilter</code>, as shown in Figure 4:</p>
<p><a name="IDAC4ESD"><b>Figure 4. Details of the filter chain</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig4.gif" width="369" height="355" alt="Details of the filter chain"></p>
<p>In this Servlet 2.3-styled configuration, <code>RedFilter</code> is applied only once on the incoming request directly from the client.</p>
<p><a name="IDAU4ESD"><span class="atitle3">Scenario 2: Combining REQUEST and INCLUDE interactions</span></a><br />
The filter mapping we will use for this scenario is shown in Listing 10. Note the use of the Servlet 2.4 syntax and the addition of the INCLUDE dispatcher sub-element to <code>RedFilter</code>.</p>
<p><a name="IDAC5ESD"><b>Listing 10. Filter mapping for combined REQUEST and INCLUDE interactions</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
  <filter-name>Add Attributes Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
  <filter-name>Red Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
</filter-mapping>
</code></pre>
</td>
</tr>
</table>
<p>Restart Tomcat 5 and access the application again with the <code>http://<hostname>:8080/dvworks/jsp/filtercount.jsp</code> URL. The response shown in Figure 5 displays the filter count.</p>
<p><a name="IDAQ5ESD"><b>Figure 5. REQUEST and INCLUDE filtering<br />
</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig5.gif" width="525" height="268" alt="REQUEST and INCLUDE Filtering"></p>
<p>Now <code>RedFilter</code> has been called twice &#8212; once during the incoming request, and the second time with the inclusion of included.jsp. The two calls are detailed in the interaction diagram shown in Figure 6. Note that we have simplified the diagram by showing only the flow of the request into the system (and not the detailed return flow as was done previously).</p>
<p><a name="IDAFAFSD"><b>Figure 6. Combined REQUEST and INCLUDE interaction</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig6.gif" width="430" height="364" alt="Combined REQUEST and INCLUDE Interaction"></p>
<p><a name="IDASAFSD"><span class="atitle3">Scenario 3: Combining REQUEST, INCLUDE, and FORWARD interactions</span></a><br />
Next, we will bring in another simple JSP page, called forwarder.jsp, shown in Listing 11. It simply uses the dispatcher to forward the incoming request to filtercount.jsp.</p>
<p><a name="IDA2AFSD"><b>Listing 11. Code for forwarder.jsp</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<jsp:forward page="/jsp/filtercount.jsp"/>
</code></pre>
</td>
</tr>
</table>
<p>Now we can add <code>BlueFilter</code> to the deployment descriptor, as shown in Listing 12:</p>
<p><a name="IDALBFSD"><b>Listing 12. Filter mapping for combined REQUEST, INCLUDE, and FORWARD interactions</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
  <filter-name>Add Attributes Filter</filter-name>

  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
  <filter-name>Red Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter-mapping>
  <filter-name>Blue Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>FORWARD</dispatcher>
</filter-mapping>
</code></pre>
</td>
</tr>
</table>
<p><code>BlueFilter</code> is configured to handle forwarded requests only, while the rest of the filter mapping remains unchanged.</p>
<p>Restart Tomcat 5 and access the application with the <code>http://<hostname>:8080/dvworks/jsp/forwarder.jsp</code> URL. Figure 7 shows the response.</p>
<p><a name="IDA4BFSD"><b>Figure 7. REQUEST, INCLUDE, and FORWARD filtering<br />
</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig7.gif" width="556" height="279" alt="REQUEST, INCLUDE, and FORWARD Filtering"></p>
<p>In this case, we see that <code>BlueFilter</code> is actually called once &#8212; during the forwarding of the request from forwarder.jsp to filtercount.jsp. The interaction diagram in Figure 8 shows the flow.</p>
<p><a name="IDAQCFSD"><b>Figure 8. Combined REQUEST, INCLUDE, and FORWARD interactions</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig8.gif" width="461" height="351" alt="Combined REQUEST, INCLUDE, and FORWARD Interactions"></p>
<p><a name="IDA3CFSD"><span class="atitle3">Scenario 4: Combining REQUEST, INCLUDE, FORWARD, and legacy Servlet 2.3 interactions</span></a><br />
In this scenario, we are adding a filter from the previous filtering article (see <a href="#resources">Resources</a>). You can use <code>ReplaceTextFilter</code> to replace text in the response. We configure it using initial parameters in the <code><filter></code> definition shown in Listing 13:</p>
<p><a name="IDATDFSD"><b>Listing 13. Filter definition for ReplaceTextFilter with initialization parameters</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
    <filter>
        <filter-name>Replace Text Filter</filter-name>
        <filter-class>com.ibm.devworks.filters.ReplaceTextFilter
        </filter-class>
         <init-param>
<param-name>search</param-name>
<param-value>color="red"</param-value>
	  </init-param>
        <init-param>
<param-name>replace</param-name>
<param-value>color="green"</param-value>
	  </init-param>
    </filter>
</code></pre>
</td>
</tr>
</table>
<p>We then add the following <code><filter-mapping></code> to the ones used in the previous scenario, as shown in Listing 14:</p>
<p><a name="IDACEFSD"><b>Listing 14. Filter mapping for combined REQUEST, INCLUDE, FORWARD, and legacy Servlet 2.3 filter interactions</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
  <filter-name>Replace Text Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
</filter-mapping>
...
</code></pre>
</td>
</tr>
</table>
<p>Note that we are not specifying a <code><dispatcher></code> sub-element here, and therefore this filter is defaulting to REQUEST-only processing. </p>
<p>Restart Tomcat 5 and access the <code>http://<hostname>:8080/dvworks/jsp/forwarder.jsp</code> URL. You should see something similar to Figure 9. Unlike the previous configuration, now the included box is green.</p>
<p><a name="IDAVEFSD"><b>Figure 9. Combined REQUEST, INCLUDE, FORWARD, and legacy filtering<br />
</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig9.gif" width="556" height="279" alt="Combined REQUEST, INCLUDE, FORWARD and Legacy Filtering"></p>
<p>The interaction diagram shown in Figure 10 illustrates how <code>ReplaceTextFilter</code> is handed the response for final processing before passing it back to the client. It is here that the color of the table is changed from red to green.</p>
<p><a name="IDAHFFSD"><b>Figure 10. Combined REQUEST, INCLUDE, FORWARD, and legacy interactions</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig10.gif" width="527" height="351" alt="Combined REQUEST, INCLUDE, FORWARD and Legacy Interactions"></p>
<p>Servlet 2.4 containers are completely backward compatible with Servlet 2.3 filters, definitions, and mappings.</p>
<p><a name="IDAVFFSD"><span class="atitle3">Scenario 5: Filtering on ERROR dispatch</span></a><br />
For the final scenario, we will briefly examine the application of a filter when dispatching to an error-handling page. The filter mapping that we will use is in Listing 15. Make sure you remove all other filter mappings in web.xml.</p>
<p><a name="IDA5FFSD"><b>Listing 15. Filtering on ERROR</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<filter-mapping>
  <filter-name>Red Filter</filter-name>
  <url-pattern>/jsp/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
  <dispatcher>ERROR</dispatcher>
</filter-mapping>
</code></pre>
</td>
</tr>
</table>
<p>To purposely generate an error, we create a JSP page, called errorgen.jsp, which sets up a page called errorhdlr.jsp to handle an error, and then throws an exception, as shown in Listing 16:</p>
<p><a name="IDAKGFSD"><b>Listing 16. Code for errorgen.jsp</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<%@page errorPage="/jsp/errorhdlr.jsp" %>

<%
    if (true)
      throw (new Exception("Purposely generated exception!"));
%>

</code></pre>
</td>
</tr>
</table>
<p>When an error is caught by the page, the container forwards the request to the <code>/jsp/errorhdlr.jsp</code> page, as specified in the <code>@page</code> directive. The errorhdlr.jsp page contains the code shown in Listing 17:</p>
<p><a name="IDA3GFSD"><b>Listing 17. Code for errorhdlr.jsp</b></a><br />
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#CCCCCC">
<tr>
<td>
<pre><code>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@page isErrorPage="true" %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<H1>developerWorks Tomcat 5 Error Page</H1>


<FONT FACE="verdana,arial,sans serif" SIZE="4">
<c:if test="${(requestScope.BlueCounter != null) &#038;&#038;
    (requestScope.BlueCounter > 0)}">
  <font color="blue">The BlueFilter has been activated
      ${requestScope.BlueCounter} times.</font>
</c:if>
<c:if test="${(requestScope.RedCounter != null) &#038;&#038;
    (requestScope.RedCounter > 0)}">
  <font color="red">The RedFilter has been activated
      ${requestScope.RedCounter} times.</font>
</c:if>

Error information:
<i>${pageContext.errorData.throwable.message}</i>
</FONT>
</BODY>

</code></pre>
</td>
</tr>
</table>
<p>The errorhdlr.jsp prints out the filter counter values, then prints out the message of the exception being caught using the EL.</p>
<p>Restart Tomcat 5 and access the <code>http://<hostname>:8080/dvworks/jsp/errorgen.jsp</code> URL. Even though you attempt to access errorgen.jsp, it is errorhdlr.jsp that will be displayed (because an exception is explicitly thrown). The error page that you will see is shown in Figure 11:</p>
<p><a name="IDAMHFSD"><b>Figure 11. REQUEST and ERROR filtering<br />
</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig11.gif" width="569" height="300" alt="REQUEST and ERROR Filtering"></p>
<p>Note that <code>RedFilter</code> has been called twice &#8212; once at the REQUEST level and a second time when the container forwards to the error page.</p>
<p>You can apply Servlet 2.4 filters just before the processing of a custom error-handling Web resource.</p>
<p><a name="IDACIFSD"><span class="atitle2">Filters and Model 2 Web application frameworks</span></a><br />
The enhanced filtering capability in Tomcat 5 provides new deployment opportunities when using popular application frameworks. Frameworks such as Struts and Turbine (see <a href="#resources">Resources</a>) use a JSP Model 2 architecture to separate data operations (the Model in an MVC pattern) from the business logic operations, and the presentation operations (the View). Their functionality centers around the use of a switching servlet (the Controller servlet) that forwards incoming requests to different user-created Action components, either according to a static XML directive file or using runtime introspection. These requests are typically further forwarded between components, until the response is complete. The Model 2 architecture enables designers to componentize their server-side coding for adaptability to change and easier long-term maintenance. </p>
<p>Because the dispatcher is used extensively to forward requests between the controller servlet and the application components, as well as between application components, you can readily add filters to the processing flow. With the Servlet 2.4 enhancements, filters can now become an integral part of a Web application&#8217;s components mix &#8212; when using Model 2 application frameworks.</p>
<table width="30%" cellpadding="5" cellspacing="0" border="1" align="right">
<tr>
<td background="/developerworks/i/bg-gold.gif"><a name="IDAQIFSD"><b>An architectural pattern from the hardware domain</b></a><br />
A novel way of thinking of a cluster of servers running a maximally scaled Web application is through the analogy of a microprocessor. Incoming requests span a finite set of possible operations like a CPU&#8217;s instruction set. Processing of requests by the servers is analogous to the execution of instructions by the hardware core.
</td>
</tr>
</table>
<p><a name="IDAZIFSD"><span class="atitle2">Pipelining your application toward a high-performance future</span></a><br />
Pipelining is a request flow-centric view of componentized request processing. It focuses on the multistage processing of a single request as it flows through the application server. </p>
<p>In the pipeline model, a request flows through an assembly line (the pipeline) while at each stage being modified/transformed/processed by a series of processors, until finally the response is generated and expedited back to the client. Popular Web application frameworks such as Jakarta Struts and Turbine, through the virtue of their JSP Model 2 architecture, already componentize the server-side logic in a pipelined fashion.</p>
<p>Figure 12 shows the typical pipeline stages that a Web application or service request may flow through when displaying a page of data:</p>
<p><a name="IDAEJFSD"><b>Figure 12. Typical stages of the pipeline model<br />
</b></a><br /><img src="http://images.ientrymail.com/javapronews/fig12.gif" width="459" height="330" alt="Typical Stages of the Pipeline Model"></p>
<p>In summary, the request is passed through the three pipeline stages shown in Table 3:</p>
<p><b>Table 3. Pipeline model stages</b></p>
<table width="100%" cellspacing="0" cellpadding="3" border="1">
<tr valign="top">
<td><b>Name of pipeline stage</b></td>
<td><b>Description of typical operation performed</b></td>
</tr>
<tr>
<td align="left" valign="top">Data fetch</td>
<td align="left" valign="top">Fetches data from external systems (such as JDBC datasource), based on information from the incoming request</td>
</tr>
<tr>
<td align="left" valign="top">Processing</td>
<td align="left" valign="top">Validates or transforms data elements using the value of the data element to look up further data, such as from internal or external sources</td>
</tr>
<tr>
<td align="left" valign="top">Rendering</td>
<td align="left" valign="top">Creates the output response based on the processed data, typically in a visual format (such as HTML) or an interchange format (such as XML)</td>
</tr>
</table>
<p>By placing design focus on the request processing pipeline, Web application design is entering a new era of performance tuning and optimization possibilities. Many of the same techniques being exploited in modern microprocessor hardware design &#8212; in the optimization of pipelines &#8212; can be leveraged in the near future for optimization of Web application server software and hardware.</p>
<p>For example, in a Web application that has similar requirements for every request flowing through the data fetch stage of processing, the optimized application server/hardware platform can prefetch and locally cache the most commonly accessed data &#8212; completely eliminating the data fetch overhead for most incoming requests. Another example &#8212; for requests that demand significant CPU processing resources in the rendering stage, such as XSLT transformation or other XML parsing &#8212; a parallel bank of hardware-accelerated XML processors can be configured in the rendering stage of the pipeline. While these optimizations are still slightly futuristic in terms of practical ability to implement them today, designing Web applications with consideration for the pipeline model is a necessary element to make them reality.</p>
<p><b>Conclusions</b></p>
<p>Tomcat 5&#8242;s new filtering feature enables us to tap into every stage of the Web application&#8217;s request-processing flow. This capability facilitates the use of filters with application frameworks and opens up new performance optimization and tuning possibilities.</p>
<p><b>Resources</b></p>
<ul>
<li><a href="ftp://www6.software.ibm.com/software/developer/library/j-tomcat2.zip">Download</a><br />
the Web application, filters, and JSP source code for this article.</li>
<li>For an introduction to Tomcat filters, how they work, and how to code them,<br />
read &#8220;<a href="http://www-106.ibm.com/developerworks/java/library/j-tomcat/">Filtering<br />
tricks for your Tomcat</a>&#8220;, also by Sing Li (<i>developerWorks</i>, June 2001).</li>
<li>Download the latest version of Apache Tomcat at the <a href="http://jakarta.apache.org/tomcat/index.html">official<br />
Tomcat Web site</a>. You can download the <a href="http://jakarta.apache.org/builds/jakarta-tomcat/release/">alpha<br />
release of the Tomcat 5.0 server</a>.</li>
<li>Download the latest version of JSTL at the <a href="http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html">Apache<br />
Jakarta Taglib site</a>. You can obtain the specification at <a href="http://www.jcp.org/en/jsr/detail?id=52">JSR-52</a>.</li>
<li>At the time of publication, Mark Kolb is in the process of writing a four-part<br />
series on JSTL. Part 1, &#8220;<a href="http://www-106.ibm.com/developerworks/java/library/j-jstl0211.html">The<br />
expression language</a>&#8221; (<i>developerWorks</i>, February 2003), introduces JSTL<br />
and the EL; Part 2, &#8220;<a href="http://www-106.ibm.com/developerworks/java/library/j-jstl0318/">Getting<br />
down to the core</a>&#8221; (<i>developerWorks</i>, March 2003), details flow control<br />
and URL management through custom tags.</li>
<li>Filtering enhancements are described in the Servlet 2.4 specification. You<br />
can find the latest in <a href="http://jcp.org/aboutJava/communityprocess/first/jsr154/">JSR-154</a>.</li>
<li>The latest status and more information on the JavaServer Pages 2.0 specification,<br />
including coverage of the proposed Expression Language (EL), can be found in <a href="http://jcp.org/aboutJava/communityprocess/first/jsr152/index.html/">JSR-152</a>.</li>
<li>Learn more about Model 2 Web application development using the Struts application<br />
framework. See the <a href="http://jakarta.apache.org/struts/index.html">official<br />
Struts Web site</a> for detailed information and the latest developments.</li>
<li>Learn how to <a href="http://www-106.ibm.com/developerworks/cgi-bin/click.cgi?url=http://www7b.software.ibm.com/wsdd/library/tutorials/vajwebsph353/Part-I/JSP11Part-I.html&#038;origin=j">use<br />
JSP and custom tags within VisualAge for Java and WebSphere Studio</a> in this<br />
tutorial from <a href="http://www-106.ibm.com/developerworks/cgi-bin/click.cgi?url=http://www7b.software.ibm.com/wsdd/&#038;origin=j">WebSphere<br />
Developer Domain</a>.</li>
<li>Discover how to create &#8220;<a href="http://www-106.ibm.com/developerworks/cgi-bin/click.cgi?url=http://www7b.software.ibm.com/wsdd/techjournal/0107_deboer/deboer.html&#038;origin=j">Advanced<br />
JSP Tag Libraries using Apache Tomcat and VisualAge for Java</a>&#8221; (<a href="http://www-106.ibm.com/developerworks/cgi-bin/click.cgi?url=http://www7b.software.ibm.com/wsdd/techjournal/&#038;origin=j"><i>WebSphere<br />
Developer Technical Journal</i></a>, July 2001).</li>
<li>You&#8217;ll find hundreds of articles about every aspect of Java programming in<br />
the <a href="http://www-106.ibm.com/developerworks/java/"><i>developerWorks</i><br />
Java technology zone</a>.</li>
<p>First published <a href="http://www.ibm.com/developerWorks">IBM developerWorks</a> (<a href="http://www-106.ibm.com/developerworks/java/library/j-tomcat2">http://www-106.ibm.com/developerworks/java/library/j-tomcat2</a>).
</ul>
<p>Sing Li is the author of <a href="http://www.wrox.com/books/1861006357.htm">Early Adopter JXTA</a> and <a href="http://www.wrox.com/Books/1861003552.htm">Professional Jini</a>, as well as numerous other books with Wrox Press. He is a regular contributor to technical magazines and is an active evangelist of the P2P evolution. Sing is a consultant and freelance writer and can be reached at westmakaha@yahoo.com. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/taming-your-tomcat-filtering-tricks-for-tomcat-2003-03/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 1/33 queries in 0.019 seconds using memcached
Object Caching 448/529 objects using memcached

Served from: webpronews.com @ 2012-02-13 02:11:23 -->
