<?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>LogikDevelopment &#187; Java</title>
	<atom:link href="http://www.logikdev.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Fri, 27 Aug 2010 08:54:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to configure JSF to get the browser Back button working</title>
		<link>http://www.logikdev.com/2010/06/23/configure-jsf-to-get-the-back-button-working/</link>
		<comments>http://www.logikdev.com/2010/06/23/configure-jsf-to-get-the-back-button-working/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 20:03:56 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Back button]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[MyFaces]]></category>
		<category><![CDATA[numberOfViewsInSession]]></category>
		<category><![CDATA[RichFaces]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=615</guid>
		<description><![CDATA[Lately, I had a problem with one of my JSF applications which is using RichFaces. The problem was happening when the user was hitting the browser Back button. Well, you would say that it is a usual problem in web development. But still, because we cannot disable the browser Back button, the web application needs [...]]]></description>
			<content:encoded><![CDATA[<p>Lately, I had a problem with one of my JSF applications which is using RichFaces.<br />
The problem was happening when the user was hitting the browser Back button. Well, you would say that it is a usual problem in web development. But still, because we cannot disable the browser Back button, the web application needs to work fine if the user decides to click on it!</p>
<p>Anyway, let&#8217;s get back on topic. As I said, the problem occurred if the user was clicking on the Back button but the funniest thing is it was happening when he was clicking twice on it! Why did it work fine when clicking once but not twice? <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> </p>
<p>The solution is quite simple actually.<br />
It was coming from one of the options in MyFaces configuration: <code>com.sun.faces.numberOfViewsInSession</code>.<br />
Here is a quick explanation of this option:</p>
<blockquote><p>
<strong>com.sun.faces.numberOfViewsInSession</strong><br />
Specifies the number of views that are stored in the session when Server-Side State Saving is used. If set to true while client-side state saving is being used, reduces the number of bytes sent to the client by compressing the state before it is encoded and written as a hidden field. The default for this parameter is 15.
</p></blockquote>
<p>So basically, JSF is storing each page previously viewed by the user in session. And, as you can see from the description above, JSF will stored a maximum of <strong>15</strong> pages by default. However, it was set to <strong>1</strong> in my application, which means only ONE page would be stored&#8230;<br />
This was obviously the reason why the application was working fine if the user was clicking only once on the Back button but not twice! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>For the same reason, you should also check the option <code>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</code> which is default to 20:</p>
<blockquote><p>
<strong>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</strong><br />
Defines the number of the latest views that are stored in session. This option is only applicable if the state saving method is set to server. The default for this parameter is 20.
</p></blockquote>
<p>For more information about JSF options, please have a look at the following page:<br />
<a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rweb_jsfengine.html">http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rweb_jsfengine.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/06/23/configure-jsf-to-get-the-back-button-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The message tags of MyFaces and RichFaces</title>
		<link>http://www.logikdev.com/2010/05/06/message-tags-of-myfaces-and-richfaces/</link>
		<comments>http://www.logikdev.com/2010/05/06/message-tags-of-myfaces-and-richfaces/#comments</comments>
		<pubDate>Thu, 06 May 2010 19:25:37 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[FacesMessage]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[message tag]]></category>
		<category><![CDATA[MyFaces]]></category>
		<category><![CDATA[RichFaces]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=472</guid>
		<description><![CDATA[Working on an application using MyFaces and RichFaces, I had no choice but understand what is the difference between the message tag provided by Myfaces (h:message) and the message tag overridden by RichFaces (rich:message). These tags allow to display information about the first FacesMessage that is assigned to the component referenced by the &#8220;for&#8221; attribute. [...]]]></description>
			<content:encoded><![CDATA[<p>Working on an application using MyFaces and RichFaces, I had no choice but understand what is the difference between the message tag provided by Myfaces (<code>h:message</code>) and the message tag overridden by RichFaces (<code>rich:message</code>).</p>
<p>These tags allow to display information about the first FacesMessage that is assigned to the component referenced by the &#8220;for&#8221; attribute. The difference is that the RichFaces tag has some extra functionalities such as Ajax rendering, error markers and predefined css class names.<br />
Have a look at the following page for more details: <a target="_blank" href="http://livedemo.exadel.com/richfaces-demo/richfaces/message.jsf">http://livedemo.exadel.com/richfaces-demo/richfaces/message.jsf</a></p>
<p>This is all nice and well but it is not the only difference. Indeed, the HTML code generated by both these frameworks will also be different!</p>
<p>First of all, let&#8217;s see how the tag <code>&lt;h:message styleClass="errormsg" for="element"/&gt;</code> will be transformed. If there is no message to display, nothing will be generated (which is a good behaviour). However, if a message is present, the tag will be replaced by the following HTML code:</p>
<pre class="brush: xml;">
&lt;span class=&quot;errormsg&quot;&gt;Required.&lt;/span&gt;
</pre>
<p>So far, so good!</p>
<p>But now let&#8217;s check what code RichFaces is generating for the tag <code>&lt;rich:message styleClass="errormsg" for="element"/&gt;</code>.<br />
The following is the code created if there is NO message to render:</p>
<pre class="brush: xml;">
&lt;span class=&quot;rich-message errormsg&quot; id=&quot;form:j_id255&quot;&gt;
    &lt;span class=&quot;rich-message-label&quot;&gt;&lt;/span&gt;
&lt;/span&gt;
</pre>
<p>And here is the code which will replace the RichFaces tag if there is a message to display:</p>
<pre class="brush: xml;">
&lt;span id=&quot;bookingform:j_id255&quot; class=&quot;rich-message errormsg&quot;&gt;
    &lt;span class=&quot;rich-message-label&quot;&gt;Required.&lt;/span&gt;
&lt;/span&gt;
</pre>
<p>As you can see, the main difference is that RichFaces is wrapping the original <code>span</code> tag into another <code>span</code> tag. But, it is also generating some code even if there is no message to display! You would ask why is it doing that? The response is simple. The wrapper span element is necessary for RichFaces to Ajax-render the message tag if an error message has to be displayed for the targeting element.</p>
<p>So make sure you don&#8217;t put any padding or margin style in your custom CSS class which I called &#8216;errormsg&#8217; in my example. Otherwise, you might have a gap when you were expecting nothing&#8230; (this happened to me) <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/05/06/message-tags-of-myfaces-and-richfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to personalise the URLs with Faces Navigation?</title>
		<link>http://www.logikdev.com/2010/03/24/how-to-personalise-the-urls-with-faces-navigation/</link>
		<comments>http://www.logikdev.com/2010/03/24/how-to-personalise-the-urls-with-faces-navigation/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 20:01:29 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[EL expressions]]></category>
		<category><![CDATA[Faces Navigation]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[view handler]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=418</guid>
		<description><![CDATA[This is an important question if you want to have search engine friendly URLs on your website! But unfortunately, the solution is not straightforward with JavaServer Faces (JSF). First of all, for security reason JSF doesn&#8217;t allow you to use the GET method for your forms. I didn&#8217;t really understand why but this is very [...]]]></description>
			<content:encoded><![CDATA[<p>This is an important question if you want to have search engine friendly URLs on your website!<br />
But unfortunately, the solution is not straightforward with JavaServer Faces (JSF). <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>First of all, for security reason JSF doesn&#8217;t allow you to use the GET method for your forms. I didn&#8217;t really understand why but this is very (too) restrictive!<br />
Can you imagine Google doing the same thing? We would have the same URL for every search terms <code>http://www.google.co.uk/search</code> instead of something like <code>http://www.google.co.uk/search?hl=en&amp;safe=off&amp;esrch=FT1&amp;q=test&amp;meta=&amp;aq=f&amp;aqi=g10&amp;aql=&amp;oq=&amp;gs_rfai=</code>.<br />
It wouldn&#8217;t be very easy to share a search page with a friend if Google was using the POST method. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So the question is how to get around this JSF limitation?</p>
<p>Let&#8217;s take a look at how would look our <code>faces-navigation.xml</code> file for a search page:</p>
<pre class="brush: xml;">
&lt;navigation-case&gt;
    &lt;from-action&gt;#{searchBean.searchAction}&lt;/from-action&gt;
    &lt;from-outcome&gt;success&lt;/from-outcome&gt;
    &lt;to-view-id&gt;/search.xhtml&lt;/to-view-id&gt;
    &lt;redirect /&gt;
&lt;/navigation-case&gt;
</pre>
<p>In this example, all the JSF elements calling the action <code>searchBean.searchAction</code> will be redirected to the <code>search.xhtml</code> page.<br />
But, how are we going to get the search parameters into the URL?</p>
<p>Ideally, it would be great to be able to do something like the following:</p>
<pre class="brush: xml;">
&lt;navigation-case&gt;
    &lt;from-action&gt;#{searchBean.searchAction}&lt;/from-action&gt;
    &lt;from-outcome&gt;success&lt;/from-outcome&gt;
    &lt;to-view-id&gt;/search.xhtml?q=#{param.q}&lt;/to-view-id&gt;
    &lt;redirect /&gt;
&lt;/navigation-case&gt;
</pre>
<p>This solution would allow us to inject EL expressions into the URL before the page is redirected to the destination page.<br />
In order to do this, we need to create our own view handler and register it to our application.  <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
<p>The code below is the view handler class which also includes some comments:</p>
<pre class="brush: java;">
package com.logikdev.gui.handler;

import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.faces.application.ViewHandler;
import javax.faces.context.FacesContext;

import com.sun.facelets.FaceletViewHandler;

/**
 * Overrides the Facelet view handler to support EL expressions in URLs.
 * @author Stéphane Moreau
 */
public class DynamicViewHandler extends FaceletViewHandler {

	public DynamicViewHandler(ViewHandler parent) {
		super(parent);
	}

	/* (non-Javadoc)
	 * @see com.sun.facelets.FaceletViewHandler#getActionURL(javax.faces.context.FacesContext, java.lang.String)
	 */
	@Override
	public String getActionURL(FacesContext context, String viewId) {
		String queryString = null;

		// Separate the query string from the URL
		int dotIndex = viewId.lastIndexOf('.');
		int questionMarkIndex = viewId.indexOf('?');
		if (questionMarkIndex != -1) {
			queryString = viewId.substring(questionMarkIndex, dotIndex);
			viewId = viewId.substring(0, questionMarkIndex) + viewId.substring(dotIndex);
		}

		// Call the parent without the query string
		String result = super.getActionURL(context, viewId);

		// Replace the EL expressions in the URL
		ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
		ValueExpression valueExpression = expressionFactory.createValueExpression(context.getELContext(), result, String.class);
		result = (String) valueExpression.getValue(context.getELContext());

		// Replace the EL expressions in the query string
		if (queryString != null) {
			valueExpression = expressionFactory.createValueExpression(context.getELContext(), queryString, String.class);
			queryString = (String) valueExpression.getValue(context.getELContext());

	        result += queryString;
		}

	    return result;
	}

}
</pre>
<p>And the following is the code to put in the <code>faces-config.xml</code> file in order to register the newly created view handler to the application:</p>
<pre class="brush: xml;">
&lt;application&gt;
	&lt;variable-resolver&gt;org.springframework.web.jsf.DelegatingVariableResolver&lt;/variable-resolver&gt;
	&lt;view-handler&gt;com.logikdev.gui.handler.DynamicViewHandler&lt;/view-handler&gt;
&lt;/application&gt;
</pre>
<p><strong>One last thing!</strong><br />
This view handler also has a limitation which I wasn&#8217;t able to fix. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  The file extension has to ALWAYS be placed at the end of the <code>to-view-id</code> URL! The view handler will then put it back before the question mark.<br />
For example:</p>
<pre class="brush: xml;">
&lt;navigation-case&gt;
	&lt;from-action&gt;#{searchBean.searchAction}&lt;/from-action&gt;
	&lt;from-outcome&gt;success&lt;/from-outcome&gt;
	&lt;!-- The extension has to be at the end --&gt;
	&lt;to-view-id&gt;/search?q=#{param.q}.xhtml&lt;/to-view-id&gt;
	&lt;redirect /&gt;
&lt;/navigation-case&gt;
</pre>
<p>If you perform a search on &#8216;jsf&#8217; with the above navigation rule, the user will be redirected to the page <code>/search.xhtml?q=jsf</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/03/24/how-to-personalise-the-urls-with-faces-navigation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>limitToList attribute prevents flashing</title>
		<link>http://www.logikdev.com/2010/03/02/limittolist-attribute-prevents-flashing/</link>
		<comments>http://www.logikdev.com/2010/03/02/limittolist-attribute-prevents-flashing/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 18:56:36 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[flash/twinkle]]></category>
		<category><![CDATA[limitToList]]></category>
		<category><![CDATA[RichFaces]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=395</guid>
		<description><![CDATA[If you have some elements (or even the whole page) that flash/twinkle using RichFaces, it probably means that these elements are AJAX-rendering. The question is by whom and how to fix it? A lot of tags in RichFaces can AJAX-render elements such as: &#60;a4j:form&#62; &#60;a4j:jsFunction name=&#34;updateName&#34; reRender=&#34;showname&#34;&#62; &#60;a4j:actionparam name=&#34;param1&#34; assignTo=&#34;#{userBean.name}&#34; /&#62; &#60;/a4j:jsFunction&#62; &#60;/a4j:form&#62; On the above [...]]]></description>
			<content:encoded><![CDATA[<p>If you have some elements (or even the whole page) that flash/twinkle using RichFaces, it probably means that these elements are AJAX-rendering. The question is by whom and how to fix it?</p>
<p>A lot of tags in RichFaces can AJAX-render elements such as:</p>
<pre class="brush: xml;">
&lt;a4j:form&gt;
    &lt;a4j:jsFunction name=&quot;updateName&quot; reRender=&quot;showname&quot;&gt;
        &lt;a4j:actionparam name=&quot;param1&quot; assignTo=&quot;#{userBean.name}&quot;  /&gt;
    &lt;/a4j:jsFunction&gt;
&lt;/a4j:form&gt;
</pre>
<p>On the above example, the JavaScript function <code>updateName</code> will AJAX-render the element which has the ID <code>showname</code>.</p>
<p>In some cases, you would have some elements that would AJAX-render without asking them to do so!<br />
I still didn&#8217;t figure it out why. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  (if anybody has an idea, please don&#8217;t hesitate to tell me!)</p>
<p>But, I found a way to prevent this!<br />
You simply can add the following attribute to your tag:</p>
<pre class="brush: xml; light: true;">limitToList=&quot;true&quot;</pre>
<p>You even can add it to the tags that don&#8217;t have a <code>reRender</code> attribute.<br />
For example:</p>
<pre class="brush: xml;">
&lt;a4j:form&gt;
    &lt;a4j:poll id=&quot;poll&quot; interval=&quot;1000&quot; limitToList=&quot;true&quot; /&gt;
&lt;/a4j:form&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/03/02/limittolist-attribute-prevents-flashing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WritableFont doesn&#8217;t like to be static!</title>
		<link>http://www.logikdev.com/2010/01/18/writablefont-doesnt-like-to-be-static/</link>
		<comments>http://www.logikdev.com/2010/01/18/writablefont-doesnt-like-to-be-static/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 18:24:21 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ArrayIndexOutOfBoundsException]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[JExcelAPI]]></category>
		<category><![CDATA[JXL]]></category>
		<category><![CDATA[WritableFont]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=265</guid>
		<description><![CDATA[While using the tool JExcelAPI within my Java application to generate Excel spreadsheets, I got the following exception: java.lang.ArrayIndexOutOfBoundsException: 5 at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68) at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:388) at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:988) at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:692) ... It appears that this exception occurs only when you try to generate more than one Excel spreadsheet! How strange is that! After a bit of investigation, [...]]]></description>
			<content:encoded><![CDATA[<p>While using the tool <a href="http://jexcelapi.sourceforge.net/"><strong>JExcelAPI</strong></a> within my Java application to generate Excel spreadsheets, I got the following exception:</p>
<pre>java.lang.ArrayIndexOutOfBoundsException: 5
	at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68)
	at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:388)
	at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:988)
	at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:692)
	...</pre>
<p><br/>It appears that this exception occurs only when you try to generate more than one Excel spreadsheet!  How strange is that! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_eek.gif' alt='8-O' class='wp-smiley' /><br />
After a bit of investigation, it seems that the problem comes from the use of the static modifier with a <code>jxl.write.WritableFont</code> variable.</p>
<p>I unfortunately don&#8217;t have the time to check the JExcelAPI code source to understand the root cause.<br />
So my advice would be: &#8220;if you get EXACTLY the same stack trace, simply delete any static modifier you used with the <code>WritableFont</code> variables&#8221;. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/01/18/writablefont-doesnt-like-to-be-static/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy your app to the root context</title>
		<link>http://www.logikdev.com/2010/01/06/deploy-your-app-to-the-root-context/</link>
		<comments>http://www.logikdev.com/2010/01/06/deploy-your-app-to-the-root-context/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 20:10:49 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[root context]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=243</guid>
		<description><![CDATA[This is an easy trick which I am sure most of you already know. Let&#8217;s take a Java application called MyAddressBook. Its generated war file could be called myaddressbook.war. By default, when you deploy this web application to Tomcat, the URL to access it will be http://localhost:8080/myaddressbook/. And if you point a domain name such [...]]]></description>
			<content:encoded><![CDATA[<p>This is an easy trick which I am sure most of you already know.</p>
<p>Let&#8217;s take a Java application called MyAddressBook. Its generated war file could be called <code>myaddressbook.war</code>.</p>
<p>By default, when you deploy this web application to Tomcat, the URL to access it will be <em>http://localhost:8080/myaddressbook/</em>. And if you point a domain name such as &#8216;addressbook.com&#8217; to this server, the URL would be <em>http://addressbook.com/myaddressbook/</em>.</p>
<p>I don&#8217;t know for you but I don&#8217;t like to systematically have the subfolder &#8216;myaddressbook&#8217; after my domain. But maybe I am too picky! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The idea is to deploy our application in the Tomcat root context.<br />
You have two ways of doing this:</p>
<ul>
<li>Define a <code>ROOT.xml</code> file in your <code>conf/Catalina/localhost</code> folder, or;</li>
<li>Rename your war file to <code>ROOT.war</code>.</li>
</ul>
<p>Note that the case is important, it has to be ROOT in <strong>UPPERCASE</strong>! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Once this is done, you will be able to call your application via the URL <em>http://localhost:8080/</em><br />
or <em>http://addressbook.com/</em>.  Way better! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/01/06/deploy-your-app-to-the-root-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to monitor your Java application</title>
		<link>http://www.logikdev.com/2009/12/17/how-to-monitor-your-java-application/</link>
		<comments>http://www.logikdev.com/2009/12/17/how-to-monitor-your-java-application/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 22:04:35 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Hibernate MBean]]></category>
		<category><![CDATA[JMX Remote]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Zabbix]]></category>
		<category><![CDATA[Zapcat]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=207</guid>
		<description><![CDATA[It is very good to have your application and your database running on a Linux or Windows server, but who will tell you if your website is down? Who said &#8220;the users&#8221;? No, you won&#8217;t look very professional if you wait for a user complaint. What you need to do is to monitor your server. [...]]]></description>
			<content:encoded><![CDATA[<p>It is very good to have your application and your database running on a Linux or Windows server, but who will tell you if your website is down? Who said &#8220;the users&#8221;? <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_eek.gif' alt='8-O' class='wp-smiley' />  No, you won&#8217;t look very professional if you wait for a user complaint.</p>
<p>What you need to do is to monitor your server. But which tools to use? There are so many on the market&#8230; <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I tested a few of them (Hyperic, Nagios, Zenoss, Cacti, Monitis) but the one I choose is <a href="http://www.zabbix.com/" target="_blank"><strong>Zabbix</strong></a>. What I like with Zabbix is its price (free  <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> ) and the fact that it is easy to configure and very flexible. Indeed, you can monitor anything you want on the machine (CPU, network, disk space, services, etc)! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>However, if you also want to monitor your Tomcat application server or even Hibernate Java library, you need some more work.</p>
<p><br/>To monitor Tomcat, you first need to enable <strong>JMX Remote</strong>. To do so, you can have a look at the <a href="http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html" target="_blank">official documentation</a> or simply add the following parameters to your Tomcat startup script:</p>
<pre class="brush: bash; light: true;">
export CATALINA_OPTS='-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false'
</pre>
<p><br/>Then, I will recommend you to deploy <a href="http://www.kjkoster.org/zapcat/Zapcat_JMX_Zabbix_Bridge.html" target="_blank"><strong>Zapcat JMX Zabbix Bridge</strong></a> in your Tomcat web server. This tool has been developed to simplify the communication between the JMX management API inside Java applications and the Zabbix monitoring tool.</p>
<p>To read the installation instructions for Tomcat, please click on the following link:<br />
<a href="http://www.kjkoster.org/zapcat/Tomcat_How_To.html" target="_blank">http://www.kjkoster.org/zapcat/Tomcat_How_To.html</a></p>
<p><br/>Finally, if you are using Hibernate in your Java application and would like to monitor it, you have to instantiate and configure a Hibernate MBean (<code>org.jboss.hibernate.jmx.Hibernate</code>) that will be responsible for constructing a Hibernate <code>SessionFactory</code> and exposing it to your application through JNDI.</p>
<p>Here are the lines you need to add to your context XML file:</p>
<pre class="brush: xml;">
&lt;bean id=&quot;mbeanExporter&quot; class=&quot;org.springframework.jmx.export.MBeanExporter&quot; lazy-init=&quot;false&quot;&gt;
    &lt;property name=&quot;server&quot; ref=&quot;mbeanServerFactory&quot;/&gt;
    &lt;property name=&quot;beans&quot;&gt;
        &lt;map&gt;
            &lt;entry key=&quot;org.hibernate:type=statistics&quot;  value-ref=&quot;hibernateMBean&quot;/&gt;
        &lt;/map&gt;
    &lt;/property&gt;
&lt;/bean&gt;

&lt;bean id=&quot;mbeanServerFactory&quot; class=&quot;org.springframework.jmx.support.MBeanServerFactoryBean&quot;&gt;
    &lt;property name=&quot;locateExistingServerIfPossible&quot; value=&quot;true&quot;/&gt;
&lt;/bean&gt;

&lt;bean id=&quot;hibernateMBean&quot; class=&quot;org.hibernate.jmx.StatisticsService&quot;&gt;
    &lt;property name=&quot;sessionFactory&quot; ref=&quot;sessionFactory&quot;/&gt;
    &lt;property name=&quot;statisticsEnabled&quot; value=&quot;true&quot;/&gt;
&lt;/bean&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2009/12/17/how-to-monitor-your-java-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No saved view state</title>
		<link>http://www.logikdev.com/2009/11/25/no-saved-view-state/</link>
		<comments>http://www.logikdev.com/2009/11/25/no-saved-view-state/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 22:03:21 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[a4j:poll]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[BUILD_BEFORE_RESTORE]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[No saved view state]]></category>
		<category><![CDATA[RichFaces]]></category>
		<category><![CDATA[session time out]]></category>
		<category><![CDATA[ViewExpiredException]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=88</guid>
		<description><![CDATA[How many of you did already get the following error when working with JSF? I would be surprised if none of you got it at least once! HTTP ERROR: 500 /web/home.htmlNo saved view state could be found for the view identifier: /web/home.html RequestURI=/web/home.html Caused by: javax.faces.application.ViewExpiredException: /web/home.htmlNo saved view state could be found for the [...]]]></description>
			<content:encoded><![CDATA[<p>How many of you did already get the following error when working with JSF?<br />
I would be surprised if none of you got it at least once! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre><span style="font-size: large;"><strong>HTTP ERROR: 500</strong></span>

/web/home.htmlNo saved view state could be found for the view identifier: /web/home.html

RequestURI=/web/home.html
<strong>
Caused by:
</strong>
javax.faces.application.ViewExpiredException: /web/home.htmlNo saved view state could be found for the view identifier: /web/home.html
	at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:88)
	at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
	at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
	at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	...</pre>
<p>This very common error happens because your session has timed out. As you probably already know, JSF is storing the view state of your page in session. Obviously, when the session has timed out, it can&#8217;t restore the view state and so throws a <code>ViewExpiredException</code>.</p>
<p>The solution for this problem is to add the following lines in your web.xml file:</p>
<pre class="brush: xml;">
&lt;context-param&gt;
    &lt;param-name&gt;facelets.BUILD_BEFORE_RESTORE&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
&lt;/context-param&gt;
</pre>
<p>When this initialization parameter is turned on, it changes <code>ViewHandler.restoreView()</code> to build the view before asking the <code>StateManager</code> for help.</p>
<p>However, if you are using RichFaces, for some reason this is breaking a few Ajax components! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
To be honest with you, I didn&#8217;t investigate in depth why these components don&#8217;t work with this parameter set to true.</p>
<p>What I did instead is to make sure the session actually never times out! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
To do that, I am polling the server every 29 minutes (as my session time out is set to 30 minutes). Obviously, you can poll the server only every 59 minutes if you set your session time out to 60 minutes.</p>
<p>Here is the code I used to poll the server every 29 minutes:</p>
<pre class="brush: xml;">
&lt;h:form&gt;
    &lt;a4j:poll id=&quot;poll&quot; interval=&quot;1740000&quot; limitToList=&quot;true&quot; /&gt;
&lt;/h:form&gt;
</pre>
<p>Note that the interval attribute is in milliseconds (29 minutes x 60 x 1000 = 1,740,000 milliseconds).</p>
<p>This solution is far from being perfect! Indeed, if, for example, a user doesn&#8217;t close his browser during the night, it means that we will have to keep the session opened during hours! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /><br />
But, as far as I am concerned, it is still better than to throw an exception at the user face. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2009/11/25/no-saved-view-state/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RichFaces is too greedy</title>
		<link>http://www.logikdev.com/2009/11/17/richfaces-is-too-greedy/</link>
		<comments>http://www.logikdev.com/2009/11/17/richfaces-is-too-greedy/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 21:33:09 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[AjaxStateManager]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[COMPRESS_STATE_IN_SESSION]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[RichFaces]]></category>
		<category><![CDATA[state manager]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=18</guid>
		<description><![CDATA[For my first post, let&#8217;s talk a little bit about RichFaces. RichFaces is a very powerful JSF library which allows you to easily integrate Ajax capabilities into your website. To see all the components RichFaces has to offer, please click on the following link: http://livedemo.exadel.com/richfaces-demo/richfaces/actionparam.jsf I am now using this framework for about two years [...]]]></description>
			<content:encoded><![CDATA[<p>For my first post, let&#8217;s talk a little bit about <strong>RichFaces</strong>.</p>
<p>RichFaces is a very powerful JSF library which allows you to easily integrate Ajax capabilities into your website. To see all the components RichFaces has to offer, please click on the following link: <a href="http://livedemo.exadel.com/richfaces-demo/richfaces/actionparam.jsf">http://livedemo.exadel.com/richfaces-demo/richfaces/actionparam.jsf</a></p>
<p>I am now using this framework for about two years and I quite like how easy it is to use! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  However, at the start, I was only using it in small projects with less than two hundred of unique visitors a day.</p>
<p>That is why I didn&#8217;t discover earlier that RichFaces was using so much memory! Indeed, I am now working on a project that has nearly 50,000 unique visitors a day. When we decided to rebuild it using JSF and RichFaces, I didn&#8217;t think that 6Gb of RAM wouldn&#8217;t be enough to keep it running! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> </p>
<p>People who knows JSF would say: &#8220;Why don&#8217;t you use &#8216;client&#8217; as state saving method?&#8221;. Well, because of the complexity of my pages, the size of these pages increases so much that it can easily reach 2Mb (which is not acceptable). So, I need to keep the view state on server side.</p>
<p>Still in JSF, there is a way of compressing the view state before saving it in session (part of the web.xml file):</p>
<pre class="brush: xml;">
&lt;context-param&gt;
    &lt;param-name&gt;org.apache.myfaces.SERIALIZE_STATE_IN_SESSION&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
&lt;/context-param&gt;

&lt;context-param&gt;
    &lt;param-name&gt;org.apache.myfaces.COMPRESS_STATE_IN_SESSION&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
&lt;/context-param&gt;
</pre>
<p>Strangely enough, the second parameter (<code>COMPRESS_STATE_IN_SESSION</code>) doesn&#8217;t work with RichFaces. After investigating the code, it seems that the RichFaces state manager (<code>org.ajax4jsf.application.AjaxStateManager</code>) doesn&#8217;t support compression at all! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Why not? Well, I didn&#8217;t find a good reason so I decided to compress it myself. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  The solution is to extend the AjaxStateManager and compress the view state before saving it in session and uncompress it when retrieving it from the session. Pretty easy!!! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Enough talking, here is the code of this custom state manager:</p>
<pre class="brush: java;">
package org.ajax4jsf.application;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

import javax.faces.FacesException;
import javax.faces.application.StateManager;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.render.ResponseStateManager;

import org.ajax4jsf.context.ContextInitParameters;

/**
 * Overrides the Ajax state manager to enable the state compression.
 * @author Stéphane Moreau
 */
public class MyAjaxStateManager extends AjaxStateManager {
	/**
	 * Only applicable if state saving method is &quot;server&quot; (= default) and if
	 * &lt;code&gt;org.apache.myfaces.SERIALIZE_STATE_IN_SESSION&lt;/code&gt; is
	 * &lt;code&gt;true&lt;/code&gt; (= default).
	 * If &lt;code&gt;true&lt;/code&gt; (default) the serialized state will be compressed before
	 * it is written to the session.
	 * If &lt;code&gt;false&lt;/code&gt; the state will not be compressed.
	 */
	private static final String COMPRESS_SERVER_STATE_PARAM = &quot;org.apache.myfaces.COMPRESS_STATE_IN_SESSION&quot;;

	/**
	 * Default value for &lt;code&gt;org.apache.myfaces.COMPRESS_STATE_IN_SESSION&lt;/code&gt;
	 * context parameter.
	 */
	private static final boolean DEFAULT_COMPRESS_SERVER_STATE_PARAM = true;

	private static final int UNCOMPRESSED_FLAG = 0;
	private static final int COMPRESSED_FLAG = 1;

	private final ComponentsLoader componentLoader;

	public MyAjaxStateManager(StateManager stateManager) {
		super(stateManager);
		componentLoader = new ComponentsLoaderImpl();
	}

	/**
	 * Reads the value of the &lt;code&gt;org.apache.myfaces.COMPRESS_STATE_IN_SESSION&lt;/code&gt;
	 * context parameter.
	 * @see COMPRESS_SERVER_STATE_PARAM
	 * @param context &lt;code&gt;FacesContext&lt;/code&gt; for the request we are processing.
	 * @return boolean true, if the server state steam should be compressed
	 */
	protected static boolean isCompressStateInSession(FacesContext context) {
		String value = context.getExternalContext().getInitParameter(
				COMPRESS_SERVER_STATE_PARAM);
		boolean compress = DEFAULT_COMPRESS_SERVER_STATE_PARAM;
		if (value != null) {
			compress = Boolean.valueOf(value);
		}
		return compress;
	}

	@Override
	protected Object[] buildViewState(FacesContext context) {
		Object[] viewStateArray = null;
		UIViewRoot viewRoot = context.getViewRoot();
		if (null != viewRoot &amp;&amp; !viewRoot.isTransient()) {
			TreeStructureNode treeStructure = (TreeStructureNode) getTreeStructureToSave(context);
			Object state = getComponentStateToSave(context);
			if (isSavingStateInClient(context)) {
				viewStateArray = new Object[]{treeStructure, state};
			} else {
				viewStateArray = saveStateInSession(context, treeStructure,
						handleSaveState(context, state));
			}

		}
		return viewStateArray;
	}

	@Override
	public UIViewRoot restoreView(FacesContext context, String viewId,
			String renderKitId) {
		UIViewRoot viewRoot = null;
		ResponseStateManager responseStateManager = getRenderKit(context,
				renderKitId).getResponseStateManager();
		TreeStructureNode treeStructure = null;
		Object[] state = null;
		Object[] serializedView = null;
		if (isSavingStateInClient(context)) {
			serializedView = (Object[]) responseStateManager.getState(context,
					viewId);

			if (null != serializedView) {
				treeStructure = (TreeStructureNode) serializedView[0];
				state = (Object[]) serializedView[1];
			}
		} else {
			serializedView = restoreStateFromSession(context, viewId,
					renderKitId);

			if (null != serializedView) {
				treeStructure = (TreeStructureNode) serializedView[0];
				state = (Object[]) handleRestoreState(context, serializedView[1]);
			}
		}

		if (null != treeStructure) {
			viewRoot = (UIViewRoot) treeStructure.restore(componentLoader);
			if (null != viewRoot &amp;&amp; null != state) {
				viewRoot.processRestoreState(context, state[0]);
				restoreAdditionalState(context, state[1]);
			}
		}
		return viewRoot;

	}

	private static final Object handleSaveState(FacesContext context, Object state) {
		if (ContextInitParameters.isSerializeServerState(context)) {
			ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
			ObjectOutputStream oas = null;
			try {
				OutputStream os = baos;
				if(isCompressStateInSession(context))
				{
					os.write(COMPRESSED_FLAG);
					os = new GZIPOutputStream(os, 1024);
				}
				else
				{
					os.write(UNCOMPRESSED_FLAG);
				}

				oas = new ObjectOutputStream(os);
				oas.writeObject(state);
				oas.flush();
			} catch (Exception e) {
				throw new FacesException(e);
			} finally {
				if (oas != null) {
					try {
						oas.close();
					} catch (IOException ignored) { }
				}
			}
			return baos.toByteArray();
		} else {
			return state;
		}
	}

	private static final Map&lt;String,Class&lt;?&gt;&gt; PRIMITIVE_CLASSES =
		new HashMap&lt;String,Class&lt;?&gt;&gt;(9, 1.0F);

	static {
		PRIMITIVE_CLASSES.put(&quot;boolean&quot;, boolean.class);
		PRIMITIVE_CLASSES.put(&quot;byte&quot;, byte.class);
		PRIMITIVE_CLASSES.put(&quot;char&quot;, char.class);
		PRIMITIVE_CLASSES.put(&quot;short&quot;, short.class);
		PRIMITIVE_CLASSES.put(&quot;int&quot;, int.class);
		PRIMITIVE_CLASSES.put(&quot;long&quot;, long.class);
		PRIMITIVE_CLASSES.put(&quot;float&quot;, float.class);
		PRIMITIVE_CLASSES.put(&quot;double&quot;, double.class);
		PRIMITIVE_CLASSES.put(&quot;void&quot;, void.class);
	}

	private static final Object handleRestoreState(FacesContext context, Object state) {
		if (ContextInitParameters.isSerializeServerState(context)) {
			ObjectInputStream ois = null;
			try {
				ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) state);
                InputStream is = bais;
                if(is.read() == COMPRESSED_FLAG) {
                	is = new GZIPInputStream(is);
                }
				ois = new ObjectInputStream(is) {
					@Override
					protected Class&lt;?&gt; resolveClass(ObjectStreamClass desc)
					throws IOException, ClassNotFoundException {
						String name = desc.getName();
						try {
							return Class.forName(name, true,
									Thread.currentThread().getContextClassLoader());
						} catch (ClassNotFoundException cnfe) {
							Class&lt;?&gt; clazz = PRIMITIVE_CLASSES.get(name);
							if (clazz != null) {
								return clazz;
							} else {
								throw cnfe;
							}
						}
					}
				};
				return ois.readObject();
			} catch (Exception e) {
				throw new FacesException(e);
			} finally {
				if (ois != null) {
					try {
						ois.close();
					} catch (IOException ignored) { }
				}
			}
		} else {
			return state;
		}
	}

}
</pre>
<p>To enable it, just add the following lines in your faces config file:</p>
<pre class="brush: xml;">
&lt;application&gt;
    &lt;state-manager&gt;org.ajax4jsf.application.SearchMedicaStateManager&lt;/state-manager&gt;
&lt;/application&gt;
</pre>
<p>With this state manager, my web application is now using less than 1Gb of memory and is working perfectly fine! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2009/11/17/richfaces-is-too-greedy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
