<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>jsf &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/jsf/</link>
	<description>Feed of posts on WordPress.com tagged "jsf"</description>
	<pubDate>Sat, 28 Nov 2009 13:03:21 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Update on Recent Changes]]></title>
<link>http://jsfguy.wordpress.com/2009/11/27/update-on-recent-changes/</link>
<pubDate>Fri, 27 Nov 2009 22:19:58 +0000</pubDate>
<dc:creator>jsfguy</dc:creator>
<guid>http://jsfguy.wordpress.com/2009/11/27/update-on-recent-changes/</guid>
<description><![CDATA[Those of you who are Infragistics customers will by now have read their notice that they are discont]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Those of you who are Infragistics customers will by now have read their notice that they are discontinuing their JSF efforts. The 9.2 version of NetAdvantage for JSF is the last. They will continue support for a year.</p>
<p>I have left Infragistics and am currently involved in developing a large JSF application using Tomahawk. </p>
<p>I will continue this blog but with a greater emphasis on the larger JSF world. If you have questions about NetAdvantage feel free to post them here. I will do what I can to help you. </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Live Charts in JSF using Primefaces]]></title>
<link>http://technicalbrainwave.wordpress.com/2009/11/27/live-charts-in-jsf-using-primefaces/</link>
<pubDate>Fri, 27 Nov 2009 11:47:12 +0000</pubDate>
<dc:creator>Gift Sam</dc:creator>
<guid>http://technicalbrainwave.wordpress.com/2009/11/27/live-charts-in-jsf-using-primefaces/</guid>
<description><![CDATA[Introduction Quite some time back I had wrote an article about &#8220;Charts in JSF using Primefaces]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Introduction</strong></p>
<p>Quite some time back I had wrote an article about<a href="http://technicalbrainwave.wordpress.com/2009/11/23/charts-in-jsf-using-primefaces/" target="_blank"> &#8220;Charts in JSF using Primefaces&#8221;</a>, where I had specified the ways to construct the commonly used charts for a web application. But in this article let us learn how to construct a chart that displays the live data. Primefaces charts has built in support for ajax-polling and provides a feature for diplaying live, dynamic, real-time data which is based on flash. This feature may be used in our real time application to indicate the changing temperatures or to show the profit/loss in a stock market. Before proceeding in to this article, you need to configure Primefaces along with JSF in your favourite IDE. I hope the article <a href="http://technicalbrainwave.wordpress.com/2009/11/07/step-by-step-tutorial-to-setup-primefaces-in-netbeans6-x/" target="_blank">“Step by step tutorial to setup Primefaces in Netbeans”</a> would be helpful to do so, and also we should have the prerequisites stated below,</p>
<p><strong>Things You’ll Need</strong></p>
<ul>
<li>Your Favourite IDE</li>
<li>Tomcat 6.x/Glassfish/Jboss</li>
<li>JDK 1.5 and above</li>
</ul>
<p>I assume that you had configured the primefaces in your favourite IDE and now let us start constructing live charts for a JSF application using Primefaces. <!--more-->Thanks for the excellent resource provided in the <a href="http://code.google.com/p/primefaces/wiki/Charts" target="_blank">Primefaces wiki</a> and the charts are,</p>
<ol>
<li>Live Pie Chart</li>
<li>Live Column Chart</li>
<li>Live Bar Chart</li>
</ol>
<p><strong>Live Pie Chart</strong></p>
<p>A pie chart illustrates percentage and shows the proportional size of items that make up a data series to the sum of the items. it always shows only one data series and is useful when you want to emphasize a significant element. Inorder to construct Live Pie charts in JSF using Primefaces, we shall construct a sample page which shows the &#8220;Lunch sales of a shop&#8221;. Let us begin by creating a backing bean for the pie chart, and it requires two backing bean named PieChartLiveBean and LunchSalesBean.</p>
<p><em><strong>PieChartLiveBean.java</strong></em></p>
<p>This backing bean contains the actual data to be feeded in the Live Pie Chart.</p>
<pre class="brush: css;">

package com.sample.primefaces;

/**
 *
 * @author Giftsam
 */
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class PieChartLiveBean implements Serializable
{

 private List&#60;LunchSalesBean&#62; lunchSalesList;

 public PieChartLiveBean()
 {
 lunchSalesList = new ArrayList&#60;LunchSalesBean&#62;();
 lunchSalesList.add(new LunchSalesBean(&#34;Beverages&#34;, 10));
 lunchSalesList.add(new LunchSalesBean(&#34;Desserts&#34;, 8));
 lunchSalesList.add(new LunchSalesBean(&#34;Soup&#34;, 4));
 lunchSalesList.add(new LunchSalesBean(&#34;Sandwiches&#34;, 6));
 }

 public List&#60;LunchSalesBean&#62; getLunchSalesList()
 {
 int beveragesPercent = (int) (Math.random() * 100);
 int dessertsPercent = (int) (Math.random() * 100);
 int soupPercent = (int) (Math.random() * 100);
 int sandwitchesPercent = (int) (Math.random() * 100);

 lunchSalesList.get(0).setSalesPercentage(beveragesPercent);
 lunchSalesList.get(1).setSalesPercentage(dessertsPercent);
 lunchSalesList.get(2).setSalesPercentage(soupPercent);
 lunchSalesList.get(3).setSalesPercentage(sandwitchesPercent);
 return lunchSalesList;
 }
}
</pre>
<p><em><strong>LunchSalesBean.java</strong></em></p>
<p>This class contains the details of the dishes available in the shop. (ie) the dish name and the sales percent of the particular dish, which is to be feeded by PieChartLiveBean Class.</p>
<pre class="brush: css;">

package com.sample.primefaces;

/**
 *
 * @author Giftsam
 */
public class LunchSalesBean
{

 private String dishName;
 private int salesPercentage;

 public LunchSalesBean()
 {
 }

 public LunchSalesBean(String dishName, int salesPercentage)
 {
 this.dishName = dishName;
 this.salesPercentage = salesPercentage;
 }

 /**
 * @return the dishName
 */
 public String getDishName()
 {
 return dishName;
 }

 /**
 * @param dishName the dishName to set
 */
 public void setDishName(String dishName)
 {
 this.dishName = dishName;
 }

 /**
 * @return the salesPercentage
 */
 public int getSalesPercentage()
 {
 return salesPercentage;
 }

 /**
 * @param salesPercentage the salesPercentage to set
 */
 public void setSalesPercentage(int salesPercentage)
 {
 this.salesPercentage = salesPercentage;
 }
}
</pre>
<p>Now we had created the Data for the chart and next we need a write a managed bean for PieChartLiveBean class in the faces-config.xml.</p>
<pre class="brush: css;">
&#60;managed-bean&#62;
&#60;managed-bean-name&#62;PieChartLiveBean&#60;/managed-bean-name&#62;
&#60;managed-bean-class&#62;com.sample.primefaces.PieChartLiveBean&#60;/managed-bean-class&#62;
&#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
&#60;/managed-bean&#62;
</pre>
<p>And finally we need to create a JSP document. Let us name the JSP document as pieChartLive.jsp and it contains the following code,</p>
<p><em><strong>pieChartLive.jsp</strong></em></p>
<pre class="brush: css;">

&#60;%--
 Document   : pieChartLive
 Author     : Giftsam
--%&#62;

&#60;%@ page language=&#34;java&#34; contentType=&#34;text/html; charset=ISO-8859-1&#34;
 pageEncoding=&#34;ISO-8859-1&#34;%&#62;
&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/html&#34; prefix=&#34;h&#34;%&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/core&#34; prefix=&#34;f&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;
&#60;%@ taglib uri=&#34;http://primefaces.prime.com.tr/ui&#34; prefix=&#34;p&#34; %&#62;

&#60;f:view&#62;
 &#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62;
 &#60;title&#62;PieChartLive&#60;/title&#62;
 &#60;p:resources/&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form id=&#34;livePieChartForm&#34;&#62;
 &#60;p:pieChart id=&#34;votes&#34; value=&#34;#{PieChartLiveBean.lunchSalesList}&#34; var=&#34;lunchSalesBean&#34;
 live=&#34;true&#34; refreshInterval=&#34;3000&#34;
 categoryField=&#34;#{lunchSalesBean.dishName}&#34; dataField=&#34;#{lunchSalesBean.salesPercentage}&#34; /&#62;
 &#60;/h:form&#62;
 &#60;/body&#62;
 &#60;/html&#62;
&#60;/f:view&#62;
</pre>
<p><em><strong>Attributes Used</strong></em></p>
<p>Attributes used for the above live pie chart are</p>
<p>categoryField &#8211; used to specify the pie section of the chart.</p>
<p>dataField &#8211; holds the value of the corresponding categoryField.</p>
<p>live &#8211; Set to true inorder to get live/dynamic datas.</p>
<p>refreshInterval &#8211; specifies the polling, values should be given in milliseconds.</p>
<p>Now the construction of  live pie chart is completed and now the datas in the pie chart will be dynamically changed for every 3 seconds interval. For online demos visit the <a href="http://97.107.138.40:8080/prime-showcase/ui/liveChart.jsf" target="_blank">Primefaces demo site</a>. Now let us have look on the snap of our chart.</p>
<p><em><strong>Live PieChart Snap(Lunch Sales)</strong></em></p>
<p><em><strong><br />
</strong></em></p>
<p><a href="http://technicalbrainwave.wordpress.com/files/2009/11/livepiechart2.jpg"><img title="Live PieChart" src="http://technicalbrainwave.wordpress.com/files/2009/11/livepiechart2.jpg" alt="" width="355" height="296" /></a></p>
<p>Now its time to move on to construct the next chart type (ie) the live column chart.</p>
<p><strong>Live ColumnChart</strong></p>
<p>A column chart is used to demonstrate the data changes over a period of time or exemplifies comparisons among  the items. Categories are organized horizontally, values vertically, to emphasize variation over time. In this example we shall construct a sample page which shows <em><strong>the sales of the managers in two quarters</strong></em>. Let us begin by creating a backing bean for the live column chart, and it requires two backing bean named LiveChartBean and salesBean.</p>
<p><em><strong>LiveChartBean.java</strong></em></p>
<p>This backing bean contains the actual data to be feeded in the Live Column Chart.</p>
<pre class="brush: css;">

package com.sample.primefaces;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Giftsam
 */
public class LiveChartBean
{
 private List&#60;SalesBean&#62; salesBeanList;

 public LiveChartBean()
 {
 salesBeanList = new ArrayList&#60;SalesBean&#62;();
 salesBeanList.add(new SalesBean(&#34;Peter&#34;, 1000, 500));
 salesBeanList.add(new SalesBean(&#34;Kumar&#34;, 400, 600));
 salesBeanList.add(new SalesBean(&#34;Jack&#34;, 700, 600));
 }

 /**
 * @return the salesBeanList
 */
 public List&#60;SalesBean&#62; getSalesBeanList()
 {
 int peterFirstQuaterProfit = (int) (Math.random() * 100000);
 int peterSecondtQuaterProfit = (int) (Math.random() * 100000);
 int kumarFirstQuaterProfit = (int) (Math.random() * 100000);
 int kumarSecondQuaterProfit = (int) (Math.random() * 100000);
 int jackFirstQuaterProfit = (int) (Math.random() * 100000);
 int jackSecondQuaterProfit = (int) (Math.random() * 100000);

 salesBeanList.get(0).setFirstQuaterSales(peterFirstQuaterProfit);
 salesBeanList.get(0).setSecondQuaterSales(peterSecondtQuaterProfit);
 salesBeanList.get(1).setFirstQuaterSales(kumarFirstQuaterProfit);
 salesBeanList.get(1).setSecondQuaterSales(kumarSecondQuaterProfit);
 salesBeanList.get(2).setFirstQuaterSales(jackFirstQuaterProfit);
 salesBeanList.get(2).setSecondQuaterSales(jackSecondQuaterProfit);
 return salesBeanList;
 }
}
</pre>
<p><em><strong>SalesBean.java</strong></em></p>
<p>This class contains the sales details of the three managers Peter, Kumar and Jack. (ie) the manager name and the sales profit details of the relevant manager in two quaters, which is to be feeded by LiveChartBean Class.</p>
<pre class="brush: css;">

package com.sample.primefaces;

/**
 *
 * @author Giftsam
 */
public class SalesBean
{
private String managerName;
 private int firstQuaterSales;
 private int secondQuaterSales;

 public SalesBean()
 {
 }

 public SalesBean(String managerName, int firstQuaterSales, int secondQuaterSales)
 {
 this.managerName = managerName;
 this.firstQuaterSales = firstQuaterSales;
 this.secondQuaterSales = secondQuaterSales;
 }

 /**
 * @return the managerName
 */
 public String getManagerName()
 {
 return managerName;
 }

 /**
 * @param managerName the managerName to set
 */
 public void setManagerName(String managerName)
 {
 this.managerName = managerName;
 }

 /**
 * @return the firstQuaterSales
 */
 public int getFirstQuaterSales()
 {
 return firstQuaterSales;
 }

 /**
 * @param firstQuaterSales the firstQuaterSales to set
 */
 public void setFirstQuaterSales(int firstQuaterSales)
 {
 this.firstQuaterSales = firstQuaterSales;
 }

 /**
 * @return the secondQuaterSales
 */
 public int getSecondQuaterSales()
 {
 return secondQuaterSales;
 }

 /**
 * @param secondQuaterSales the secondQuaterSales to set
 */
 public void setSecondQuaterSales(int secondQuaterSales)
 {
 this.secondQuaterSales = secondQuaterSales;
 }
}
</pre>
<p>Now we had created the Data for the chart and next we need a write a managed bean for LiveChartBean class in the faces-config.xml.</p>
<pre class="brush: css;">

&#60;managed-bean&#62;
 &#60;managed-bean-name&#62;LiveChartBean&#60;/managed-bean-name&#62;
 &#60;managed-bean-class&#62;com.sample.primefaces.LiveChartBean&#60;/managed-bean-class&#62;
 &#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
 &#60;/managed-bean&#62;
</pre>
<p>And finally we need to create a JSP document. Let us name the JSP document as columnChartLive.jsp and it contains the following code,</p>
<p><em><strong>columnChartLive.jsp</strong></em></p>
<pre class="brush: css;">

&#60;%--
 Document   : columnChartLive
 Author     : Giftsam
 --%&#62;

 &#60;%@ page language=&#34;java&#34; contentType=&#34;text/html; charset=ISO-8859-1&#34;
 pageEncoding=&#34;ISO-8859-1&#34;%&#62;
 &#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;
 &#60;%@ taglib uri=&#34;http://java.sun.com/jsf/html&#34; prefix=&#34;h&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://java.sun.com/jsf/core&#34; prefix=&#34;f&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://primefaces.prime.com.tr/ui&#34; prefix=&#34;p&#34; %&#62;

 &#60;f:view&#62;
 &#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62;
 &#60;title&#62;Live ColumnChart&#60;/title&#62;
 &#60;p:resources/&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form&#62;
 &#60;p:columnChart value=&#34;#{LiveChartBean.salesBeanList}&#34; live=&#34;true&#34; refreshInterval=&#34;3000&#34; var=&#34;salesBean&#34; xfield=&#34;#{salesBean.managerName}&#34;&#62;
 &#60;p:chartSeries label=&#34;First Quater&#34; value=&#34;#{salesBean.firstQuaterSales}&#34; /&#62;
 &#60;p:chartSeries label=&#34;Second Quater&#34; value=&#34;#{salesBean.secondQuaterSales}&#34; /&#62;
 &#60;/p:columnChart&#62;
 &#60;/h:form&#62;
 &#60;/body&#62;
 &#60;/html&#62;
 &#60;/f:view&#62;
</pre>
<p><em><strong>Attributes Used</strong></em></p>
<p>Attributes used for the above live column chart are,</p>
<p>xfield &#8211; denotes the x-axis of the chart.</p>
<p>&#60;p:chartSeries&#62; tag &#8211; used to construct the horizontal lines for the chart.</p>
<p>live – Set to true inorder to get live/dynamic datas.</p>
<p>refreshInterval – specifies the polling, values should be given in milliseconds.</p>
<p>Now the construction of  live column chart is completed and let us have look on the snap of our chart.</p>
<p><em><strong>Live ColumnChart Snap(Sales of the managers in two quaters)</strong></em></p>
<p><a href="http://technicalbrainwave.wordpress.com/files/2009/11/columnchartlive.jpg"><img title="Live ColumnChart" src="http://technicalbrainwave.wordpress.com/files/2009/11/columnchartlive.jpg" alt="" width="363" height="296" /></a></p>
<p>By invoking the above code the column chart will have dynamic datas for every 3 seconds interval. Now let us learn how to construct the live bar chart.</p>
<p><strong>Live BarChart</strong></p>
<p>A bar chart is used to illustrate comparison among individual items. In bar chart categories are organized vertically and values horizontally inorder to focus on comparing values and to place less emphasis on time. Now for live bar chart, let us conjure the same backing bean which we invoked for live column chart. Only thing we need to create a JSP document. Let us name the JSP document as barChartLive.jsp and it contains the following code,</p>
<p><em><strong>barChartLive.jsp</strong></em></p>
<pre class="brush: css;">

&#60;%--
 Document   : barChartLive
 Author     : Giftsam
 --%&#62;

 &#60;%@ page language=&#34;java&#34; contentType=&#34;text/html; charset=ISO-8859-1&#34;
 pageEncoding=&#34;ISO-8859-1&#34;%&#62;
 &#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;
 &#60;%@ taglib uri=&#34;http://java.sun.com/jsf/html&#34; prefix=&#34;h&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://java.sun.com/jsf/core&#34; prefix=&#34;f&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;
 &#60;%@ taglib uri=&#34;http://primefaces.prime.com.tr/ui&#34; prefix=&#34;p&#34; %&#62;

 &#60;f:view&#62;
 &#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62;
 &#60;title&#62;Live BarChart&#60;/title&#62;
 &#60;p:resources/&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form&#62;
 &#60;p:barChart value=&#34;#{LiveChartBean.salesBeanList}&#34; live=&#34;true&#34; refreshInterval=&#34;3000&#34;
 var=&#34;salesBean&#34; yfield=&#34;#{salesBean.managerName}&#34;&#62;
 &#60;p:chartSeries label=&#34;First Quater&#34; value=&#34;#{salesBean.firstQuaterSales}&#34; /&#62;
 &#60;p:chartSeries label=&#34;Second Quater&#34; value=&#34;#{salesBean.secondQuaterSales}&#34; /&#62;
 &#60;/p:barChart&#62;
 &#60;/h:form&#62;
 &#60;/body&#62;
 &#60;/html&#62;
 &#60;/f:view&#62;
</pre>
<p><em><strong>Attributes Used</strong></em></p>
<p>Attributes used for the above live bar chart are,</p>
<p>yfield &#8211; denotes the y-axis of the chart.</p>
<p>&#60;p:chartSeries&#62; tag &#8211; used to construct the horizontal lines for the chart.</p>
<p>live – Set to true inorder to get live/dynamic datas.</p>
<p>refreshInterval – specifies the polling, values should be given in milliseconds.</p>
<p>Now the construction of  live bar chart is completed and now  its value will be refreshed for every 3 seconds interval. Let us have look on the snap of our chart.</p>
<p><em><strong>Live BarChart Snap(<em><strong>Sales of the managers in two quaters</strong></em>)</strong></em></p>
<p><a href="http://technicalbrainwave.wordpress.com/files/2009/11/livebarchart.jpg"><img title="Live BarChart" src="http://technicalbrainwave.wordpress.com/files/2009/11/livebarchart.jpg" alt="" width="362" height="296" /></a></p>
<p>Thats all folks. I hope this article clearly explains the construction of live charts for a JSF application using Primefaces. If you find this article is useful for you, dont forget to give me your valuable comments. Have a joyous code day.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[JSF] Comunicação entre backbeans de sessão]]></title>
<link>http://ldiasrs.wordpress.com/2009/11/27/jsf-comunicacao-entre-backbeans-de-sessao/</link>
<pubDate>Fri, 27 Nov 2009 11:38:27 +0000</pubDate>
<dc:creator>ldiasrs</dc:creator>
<guid>http://ldiasrs.wordpress.com/2009/11/27/jsf-comunicacao-entre-backbeans-de-sessao/</guid>
<description><![CDATA[Esses dias quando estava desenvolvendo minha primeira aplicação com o JSF fiquei na duvida de como r]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Esses dias quando estava desenvolvendo minha primeira aplicação com o JSF fiquei na duvida de como realizar a comunicação entre backbeans com escopo de sessão.</p>
<p>Acabei utilizando a solução de colocar os beans nas propriedades da sessão, sendo que quando outro backbean precisar se comunicar o mesmo acessa as propriedades da sessão buscando o bean desejado.</p>
<p>Hoje descobri que existe uma segunda alternativa para resolver esse problema,  basta acessar a própria instancia criada pelo framework JSF, da seguinte maneira:</p>
<pre><code>
FacesContext context = FacesContext.getCurrentInstance();
//trocar o backBean pelo tipo do bean será buscado Ex: LoginManagerBean
backBean bean = (backBean) context.getExternalContext().getSessionMap().get("nome do backbean no faces-config");
</code></pre>
<p>Essa segunda alternativa me parece mais interessante, pois, não é necessário ficar gerenciando a criação dos beans nas propriedades da sessão. O um dos únicos cuidados é se certificar que no momento em que o bean for acessado/buscado, o mesmo já tenha sido &#8220;instanciado&#8221;/construído pelo sistema.</p>
<p>Referência <a href="http://javafree.uol.com.br/rss/viewtopic.jbb?t=870834" target="_blank">AQUI</a>:</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Data Exporting in JSF Using PrimeFaces]]></title>
<link>http://shunmugakrishna.wordpress.com/2009/11/27/data-exporting-in-jsf-using-primefaces/</link>
<pubDate>Fri, 27 Nov 2009 08:55:01 +0000</pubDate>
<dc:creator>shunmugakrishna</dc:creator>
<guid>http://shunmugakrishna.wordpress.com/2009/11/27/data-exporting-in-jsf-using-primefaces/</guid>
<description><![CDATA[Introduction In this article we shall learn how to export the data from the web page to a PDF, xls, ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Introduction</strong></p>
<p>In this article we shall learn how to export the data from the web page to a PDF, xls, xml and csv format in a JSF application, that may be very useful while generating a report for a web application project. Now we are going to use a component library named <a href="http://97.107.138.40:8080/prime-showcase/ui/home.jsf" target="_blank">Primefaces</a>, which has more than 70+ ajax powered components that enriches our web application with rich look and feel. So here we are going to invoke a Primefaces component named Data Exporter which is used to export the datas in the web page to a  PDF, xls, xml and csv format. I am damn sure, Primefaces reduces the complexity for the developers while constructing a report for a web application.</p>
<p><strong>Prerequisites</strong></p>
<ul>
<li>IDE – Your favourite IDE</li>
<li>Tomcat 6.x/Glassfish/Jboss</li>
<li>JDK 1.5 and above</li>
</ul>
<p>I assume that you had configured the Primefaces in your favourite IDE and now in this article let us learn by a sample &#8220;Seven wonders of the world&#8221; represented in a datatable and let us see how the datas in the data table are exported  in to a PDF, xls, xml and csv format. First let  us begin by creating a backing bean <!--more-->class named DataExporterBean and DataTableBean.</p>
<p><em><strong>DataExporterBean</strong></em><em><strong>.java</strong></em></p>
<p>This is the backing bean class for the data exporter.</p>
<pre class="brush: css;">

package com.shunmuga.primefaces;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author shunmuga
 */
public class DataExPorterBean
{

 private List&#60;DataTableBean&#62; dataTableBeanList = new ArrayList&#60;DataTableBean&#62;();

 /**
 * Create new Instance of the class
 */
 public DataExPorterBean()
 {
 initialzeComponents();
 }

 /**
 * This method is used to populate the required data table
 * data when the constructor is initialized.
 */
 private void initialzeComponents()
 {
 if (!dataTableBeanList.isEmpty())
 {
 dataTableBeanList.clear();
 }
 DataTableBean dataTableBean = new DataTableBean();
 dataTableBean.setWonders(&#34;Machu Picchu&#34;);
 dataTableBean.setCountry(&#34;Peru&#34;);
 dataTableBean.setDateOfConstruction(&#34;1460-1470&#34;);
 dataTableBeanList.add(dataTableBean);

 dataTableBean = new DataTableBean();
 dataTableBean.setWonders(&#34;Giza Pyramid Complex&#34;);
 dataTableBean.setCountry(&#34;Egypt&#34;);
 dataTableBean.setDateOfConstruction(&#34;2584-2561 BC&#34;);
 dataTableBeanList.add(dataTableBean);

 dataTableBean = new DataTableBean();
 dataTableBean.setWonders(&#34;Taj Mahal&#34;);
 dataTableBean.setCountry(&#34;Agra,India&#34;);
 dataTableBean.setDateOfConstruction(&#34;1630 A.D.&#34;);
 dataTableBeanList.add(dataTableBean);

 dataTableBean = new DataTableBean();
 dataTableBean.setWonders(&#34;Petra&#34;);
 dataTableBean.setCountry(&#34;Jordan&#34;);
 dataTableBean.setDateOfConstruction(&#34;9 B.C. – 40 A.D.&#34;);
 dataTableBeanList.add(dataTableBean);

 dataTableBean = new DataTableBean();
 dataTableBean.setWonders(&#34;Great Wall of China&#34;);
 dataTableBean.setCountry(&#34;China&#34;);
 dataTableBean.setDateOfConstruction(&#34;220 B.C and 1368 – 1644 A.D.&#34;);
 dataTableBeanList.add(dataTableBean);

 dataTableBean = new DataTableBean();
 dataTableBean.setWonders(&#34;Christ the Redeemer&#34;);
 dataTableBean.setCountry(&#34;Brazil&#34;);
 dataTableBean.setDateOfConstruction(&#34;1931&#34;);
 dataTableBeanList.add(dataTableBean);

 dataTableBean = new DataTableBean();
 dataTableBean.setWonders(&#34;Colosseum&#34;);
 dataTableBean.setCountry(&#34;Rom Italy&#34;);
 dataTableBean.setDateOfConstruction(&#34;70 – 82 A.D&#34;);
 dataTableBeanList.add(dataTableBean);

 }

 /**
 * @return the dataTableBeanList
 */
 public List&#60;DataTableBean&#62; getDataTableBeanList()
 {
 return dataTableBeanList;
 }

 /**
 * @param dataTableBeanList the dataTableBeanList to set
 */
 public void setDataTableBeanList(List&#60;DataTableBean&#62; dataTableBeanList)
 {
 this.dataTableBeanList = dataTableBeanList;
 }
}
</pre>
<p><strong>DataTableBean.java</strong></p>
<p>This class contains the required data to populate the data table such as wonder, country and the details of the seven wonders construction.</p>
<pre class="brush: css;">

package com.shunmuga.primefaces;

/**
 *
 * @author shunmuga
 */
public class DataTableBean
{

 public DataTableBean()
 {
 }
 private String wonders;
 private String country;
 private String dateOfConstruction;

 /**
 * @return the country
 */
 public String getCountry()
 {
 return country;
 }

 /**
 * @param country the country to set
 */
 public void setCountry(String country)
 {
 this.country = country;
 }

 /**
 * @return the wonders
 */
 public String getWonders()
 {
 return wonders;
 }

 /**
 * @param wonders the wonders to set
 */
 public void setWonders(String wonders)
 {
 this.wonders = wonders;
 }

 /**
 * @return the dateOfConstruction
 */
 public String getDateOfConstruction()
 {
 return dateOfConstruction;
 }

 /**
 * @param dateOfConstruction the dateOfConstruction to set
 */
 public void setDateOfConstruction(String dateOfConstruction)
 {
 this.dateOfConstruction = dateOfConstruction;
 }
}
</pre>
<p>Now the datas are populated in the data table and now let us construct a managed bean for the DataExporterBean class in the faces-config.xml</p>
<pre class="brush: css;">

&#60;faces-config version=&#34;1.2&#34;
 xmlns=&#34;http://java.sun.com/xml/ns/javaee&#34;
 xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
 xsi:schemaLocation=&#34;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&#34;&#62;
&#60;managed-bean&#62;
 &#60;description&#62;Managed bean for Export type &#60;/description&#62;
 &#60;managed-bean-name&#62;DataExporterBean&#60;/managed-bean-name&#62;
 &#60;managed-bean-class&#62;com.shunmuga.primefaces.DataExPorterBean&#60;/managed-bean-class&#62;
 &#60;managed-bean-scope&#62;request&#60;/managed-bean-scope&#62;
&#60;/managed-bean&#62;

&#60;/faces-config&#62;
</pre>
<p>Only one thing is left to export, (ie) we need create a JSP page. Let us name the JSP document as dataExporter.jsp and it contains the following code</p>
<pre class="brush: css;">

&#60;%@page contentType=&#34;text/html&#34; pageEncoding=&#34;UTF-8&#34;%&#62;

&#60;%@taglib prefix=&#34;f&#34; uri=&#34;http://java.sun.com/jsf/core&#34;%&#62;
&#60;%@taglib prefix=&#34;h&#34; uri=&#34;http://java.sun.com/jsf/html&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;
&#60;%@taglib uri=&#34;http://primefaces.prime.com.tr/ui&#34; prefix=&#34;p&#34; %&#62;
&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;

&#60;f:view&#62;
 &#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;/&#62;
 &#60;title&#62;Data Exporter&#60;/title&#62;
 &#60;p:resources/&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form id=&#34;dataExporterPageForm&#34;&#62;

 &#60;p:panel header=&#34;New Seven Wonders of the World&#34; style=&#34;position:relative; width: 532px;&#34;&#62;
 &#60;f:facet name=&#34;tittle&#34;&#62;
 &#60;h:outputText value=&#34;DataExporterSample&#34;/&#62;
 &#60;/f:facet&#62;

 &#60;%--DataTable contains seven wonders details --%&#62;

 &#60;p:dataTable value=&#34;#{DataExporterBean.dataTableBeanList}&#34;
 id=&#34;Wonders&#34;
 rows=&#34;7&#34;
 var=&#34;dataTableBean&#34;&#62;

 &#60;%-- country name column --%&#62;

 &#60;p:column&#62;
 &#60;f:facet name=&#34;header&#34;&#62;
 &#60;h:outputText value=&#34;Wonders&#34; /&#62;
 &#60;/f:facet&#62;
 &#60;h:outputText value=&#34;#{dataTableBean.wonders}&#34; /&#62;
 &#60;/p:column&#62;

 &#60;%-- country name column --%&#62;

 &#60;p:column&#62;
 &#60;f:facet name=&#34;header&#34;&#62;
 &#60;h:outputText value=&#34;Country&#34; /&#62;
 &#60;/f:facet&#62;
 &#60;h:outputText value=&#34;#{dataTableBean.country}&#34; /&#62;
 &#60;/p:column&#62;

 &#60;%-- dateOfConstruction column --%&#62;

 &#60;p:column resizable=&#34;true&#34;&#62;
 &#60;f:facet name=&#34;header&#34;&#62;
 &#60;h:outputText value=&#34;Date OF Construction&#34; /&#62;
 &#60;/f:facet&#62;
 &#60;h:outputText value=&#34;#{dataTableBean.dateOfConstruction}&#34;/&#62;
 &#60;/p:column&#62;

 &#60;/p:dataTable&#62;
 &#60;h:panelGrid columns=&#34;4&#34;&#62;

 &#60;%--This is PDF Exporting command link --%&#62;
 &#60;h:commandLink&#62;
 &#60;h:outputText  value=&#34;PDF&#34; /&#62;
 &#60;p:dataExporter type=&#34;pdf&#34; target=&#34;Wonders&#34;  fileName=&#34;SevenWonders&#34;/&#62;
 &#60;/h:commandLink&#62;

 &#60;%--This is XLs Exporting command link --%&#62;
 &#60;h:commandLink&#62;
 &#60;h:outputText  value=&#34;XL&#34; /&#62;
 &#60;p:dataExporter type=&#34;xls&#34; target=&#34;Wonders&#34;  fileName=&#34;SevenWonders&#34;/&#62;
 &#60;/h:commandLink&#62;

 &#60;%--This is XML Exporting command link --%&#62;
 &#60;h:commandLink&#62;
 &#60;h:outputText  value=&#34;XML&#34; /&#62;
 &#60;p:dataExporter type=&#34;xml&#34; target=&#34;Wonders&#34;  fileName=&#34;SevenWonders&#34;/&#62;
 &#60;/h:commandLink&#62;

 &#60;%--This is CSV Exporting command link --%&#62;
 &#60;h:commandLink&#62;
 &#60;h:outputText  value=&#34;CSV&#34; /&#62;
 &#60;p:dataExporter type=&#34;csv&#34; target=&#34;Wonders&#34;  fileName=&#34;SevenWonders&#34;/&#62;
 &#60;/h:commandLink&#62;
 &#60;/h:panelGrid&#62;
 &#60;/p:panel&#62;
 &#60;/h:form&#62;
 &#60;/body&#62;
 &#60;/html&#62;
&#60;/f:view&#62;
</pre>
<p>By now we had completed the coding part and now let us have a look on the snap shot of our sample DataExporter application.</p>
<p><strong>Snap Shot</strong></p>
<p><a href="http://shunmugakrishna.wordpress.com/files/2009/11/datatable.jpg"><img class="alignnone size-full wp-image-78" title="DataTable" src="http://shunmugakrishna.wordpress.com/files/2009/11/datatable.jpg" alt="" width="541" height="299" /></a></p>
<p>In the preceding window, you can export the datas from the data table by clicking the relevant command link specified in the bottom of the data table. I believe this article clearly explains how to use the Primefaces Data Exporter component to export the datas from the web application. If you find this article is useful to you, dont forget to give your valuable comments. Have a joyous day.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring and JSF Integrated]]></title>
<link>http://numberformat.wordpress.com/2009/11/26/spring-and-jsf-integrated/</link>
<pubDate>Thu, 26 Nov 2009 21:33:23 +0000</pubDate>
<dc:creator>numberformat</dc:creator>
<guid>http://numberformat.wordpress.com/2009/11/26/spring-and-jsf-integrated/</guid>
<description><![CDATA[This page describes the process of integrating the Spring framework with JSF. We will take an applic]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This page describes the process of integrating the Spring framework with JSF. We will take an application that already has JSF and Spring components fully initialized and ready to go. We will prove this by displaying 2 links that allow those 2 frameworks to draw a page.</p>
<p>The integration will consist of having the user submit a JSF page. The JSF framework will handle the page submit and pass the information on to a spring enabled beans.</p>
<p>Spring MVC is not absolutely required to get this to work. You could have only used the core spring (DI) container but for the purposes of this page we will have it hang around.</p>
<h3>Requirements</h3>
<ul>
<li>Maven2</li>
<li>Basic understanding of IOC and The Spring</li>
<li>Basic understanding of JSF</li>
</ul>
<h3>Having JSF Managed Beans Delegate to Spring Managed Beans</h3>
<p>We will be using the popular &#8220;DelegatingVariableResolver&#8221; to integrate these two frameworks together. The DelegatingVariableResolver class provides the ability for Spring managed beans to be injected into JSF manged beans. This is a powerful technique to allow business logic that is managed in the spring container  available for JSF applications to use.</p>
<h3>Creating the Project</h3>
<p>We will create this project using an archetype and walk thru the different parts that make this all work.</p>
<h3>generate</h3>
<pre class="brush: bash;">
mvn archetype:generate -DarchetypeGroupId=org.vtechfw -DarchetypeArtifactId=springmvc-jsf-archetype -DarchetypeVersion=1.0-SNAPSHOT -DarchetypeRepository=http://www.vermatech.com/m2repo
</pre>
<p>Maven will prompt you for some information. It is best to answer like the following.</p>
<p>groupId: testpackage<br />
artifactId: springJSF</p>
<p>Hit enter for defaults for the rest of the questions.</p>
<h3>Run</h3>
<p>cd to the project&#8217;s directory. (cd springJSF)</p>
<pre class="brush: bash;">
mvn jetty:run
</pre>
<h3>View the project</h3>
<p>Navigate to the following page: http://localhost:8080/</p>
<ol>
<li>The spring mvc configuration is read applicationContext.xml and spring-servlet.xml</li>
<li>The faces configuration file is read faces-config.xml</li>
</ol>
<p>The system completes the initialization and the web application is ready to serve requests at http://localhost:8080</p>
<p>The application displays a welcome page with 2 links. One points to the Faces JSP file that displays a text box that allows the user to enter values and submit. The second link displays a welcome page that is rendered by the SpringMVC framework.</p>
<h3>How to get JSF to use Spring Beans Works</h3>
<p>Enable the JSF system to use DelegatingVariableResolver.</p>
<p>Add the following in the faces-config.xml</p>
<pre class="brush: xml;">
&#60;application&#62;
   &#60;variable-resolver&#62;org.springframework.web.jsf.DelegatingVariableResolver&#60;/variable-resolver&#62;
&#60;/application&#62;
</pre>
<h3>Create a Spring Managed Bean</h3>
<p>Actually you dont need to create one if you already generated the project. For documentation purposes the bean is listed here.</p>
<pre class="brush: java;">
package testpackage.quickstart.springmvc;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.stereotype.Service;

@Service(&#34;datePrintModel&#34;)
public class DatePrintModelImpl implements DatePrintModel {
	private DateFormat dateFormat = new SimpleDateFormat(&#34;EEE, d MMM yyyy HH:mm:ss Z&#34;);

	public String getDateAsString() {
		System.out.println(&#34;getDataAsString called.&#34;);
		return dateFormat.format(new Date());
	}
}
</pre>
<h3>Setup the JSF Managed Bean</h3>
<p>Add the DatePrintModel and its setters and getters to the managed been below.</p>
<p>After the change it should look something like this.</p>
<pre class="brush: java;">
package testpackage.jsftest;

import javax.faces.event.ValueChangeEvent;

import testpackage.quickstart.springmvc.DatePrintModel;

public class MessageModel {

	private DatePrintModel datePrintModel;

	public DatePrintModel getDatePrintModel() {
		return datePrintModel;
	}

	public void setDatePrintModel(DatePrintModel datePrintModel) {
		this.datePrintModel = datePrintModel;
	}

	public void printMessage(ValueChangeEvent e) {
		System.out.println(&#34;old value was: &#34; + e.getOldValue());
		System.out.println(&#34;new value is: &#34; + e.getNewValue());
	}

	public void callSpringModel() {
		System.out.println(&#34;calling the spring model...&#34;);
		datePrintModel.getDateAsString();
	}
}
</pre>
<p>Modify the faces-config.xml to look like this&#8230;</p>
<pre class="brush: xml;">
&#60;?xml version='1.0' encoding='UTF-8'?&#62;
&#60;faces-config xmlns=&#34;http://java.sun.com/xml/ns/javaee&#34;
              xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
              xsi:schemaLocation=&#34;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&#34;
              version=&#34;1.2&#34;&#62;

&#60;managed-bean&#62;
	&#60;managed-bean-name&#62;message&#60;/managed-bean-name&#62;
	&#60;managed-bean-class&#62;java.lang.String&#60;/managed-bean-class&#62;
	&#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
&#60;/managed-bean&#62;
&#60;managed-bean&#62;
	&#60;managed-bean-name&#62;messageModel&#60;/managed-bean-name&#62;
	&#60;managed-bean-class&#62;testpackage.jsftest.MessageModel&#60;/managed-bean-class&#62;
	&#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
	&#60;managed-property&#62;
		&#60;property-name&#62;datePrintModel&#60;/property-name&#62;
		&#60;value&#62;#{datePrintModel}&#60;/value&#62;
	&#60;/managed-property&#62;
&#60;/managed-bean&#62;
&#60;/faces-config&#62;
</pre>
<p>As you can see above the managed-bean property has been added.</p>
<h3>Modify the JSP</h3>
<p>helloWorld.jsp</p>
<pre class="brush: xml;">
&#60;!DOCTYPE html
PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34;
&#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;%@ page contentType=&#34;text/html;charset=UTF-8&#34; language=&#34;java&#34; %&#62;
&#60;%@ taglib prefix=&#34;f&#34; uri=&#34;http://java.sun.com/jsf/core&#34; %&#62;
&#60;%@ taglib prefix=&#34;h&#34; uri=&#34;http://java.sun.com/jsf/html&#34; %&#62;

&#60;f:view&#62;
    &#60;html&#62;
    &#60;head&#62;
        &#60;title&#62;Hello World JSF Example&#60;/title&#62;
    &#60;/head&#62;
    &#60;body&#62;
    &#60;h:form&#62;
		&#60;p&#62;This is a simple hello world page using Faces.&#60;/p&#62;
		&#60;p&#62;Enter your message here: &#60;br/&#62;
		&#60;h:inputText valueChangeListener=&#34;#{messageModel.printMessage}&#34; value=&#34;#{message}&#34; size=&#34;35&#34;/&#62;&#60;/p&#62;
		&#60;h:commandButton value=&#34;Submit&#34; action=&#34;#{messageModel.callSpringModel}&#34;/&#62;
    &#60;/h:form&#62;
    &#60;p&#62;after submit check server console for output.&#60;/p&#62;
    &#60;/body&#62;
    &#60;/html&#62;
&#60;/f:view&#62;
</pre>
<h3>Run and view The Project</h3>
<pre class="brush: bash;">
mvn jetty:run
</pre>
<p>http://localhost:8080</p>
<h3>That&#8217;s all for now!</h3>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[F-35B and F-35C]]></title>
<link>http://cencio4.wordpress.com/2009/11/26/f-35b-and-f-35c/</link>
<pubDate>Thu, 26 Nov 2009 00:05:24 +0000</pubDate>
<dc:creator>David Cenciotti</dc:creator>
<guid>http://cencio4.wordpress.com/2009/11/26/f-35b-and-f-35c/</guid>
<description><![CDATA[A few days ago I wrote a post about the F-35 Lightning II is a fifth-generation, single-seat, single]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A few days ago I wrote a <a href="http://cencio4.wordpress.com/2009/11/21/first-naval-jsf-lands-at-nas-patuxent-river/">post</a> about the F-35 Lightning II is a fifth-generation, single-seat, single-engine, stealth multirole fighter, that will also equip the Aeronautica Militare (Italian Air Force, ItAF) and the Marina Militare, that will use the F-35B from the new Cavour STOVL aircraft carrier. In spite of a carrier variant designated F-35C<img class="size-full wp-image-2214 alignright" style="margin:5px;" title="F-35C" src="http://cencio4.wordpress.com/files/2009/11/sdd_f35testc_009.jpg" alt="" width="273" height="218" />, the RAF and Royal Navy will use the B variant from aircraft carriers and the U.S. Marines Corps are investigating the use of the Ship-borne Rolling and Vertical Landing (SRVL) method to operate F-35Bs from the aircraft carrier without disrupting carrier operations as the landing method uses the same pattern of approach as wire arrested landings. The F-35C carrier (whose only user will be the US Navy to replace the &#8220;legacy Hornets&#8221; and complement the Super Hornets) variant will be much similar to the A and B versions, but will have larger, folding wings and larger control surfaces for improved low-speed control. The aircraft will also be equipped with a stronger landing gear and hook for the stresses of carrier trap landings.</p>
<p>The following front, side and top views of the three variants will give an idea of the main differences among the F-35A, B and C.</p>

</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Sharing F-35 software code not that easy]]></title>
<link>http://ericpalmer.wordpress.com/2009/11/25/sharing-f-35-software-code-not-that-easy/</link>
<pubDate>Wed, 25 Nov 2009 10:50:42 +0000</pubDate>
<dc:creator>Eric Palmer</dc:creator>
<guid>http://ericpalmer.wordpress.com/2009/11/25/sharing-f-35-software-code-not-that-easy/</guid>
<description><![CDATA[There seems to be a lot of fuss going on about JSF partner nations not getting to have access to the]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://ericpalmer.wordpress.com/files/2009/11/f-35software.jpg"><img src="http://ericpalmer.wordpress.com/files/2009/11/f-35software.jpg" alt="" title="f-35software" width="503" height="297" class="aligncenter size-full wp-image-2179" /></a></p>
<p>There seems to be <a href="http://www.dodbuzz.com/2009/11/24/us-guards-jsf-software-crown-jewels/?utm_source=feedburner&#38;utm_medium=feed&#38;utm_campaign=Feed%3A+dodbuzz+%28DoD+Buzz%29">a lot of fuss</a> going on about JSF partner nations not getting to have access to the software code to the F-35. This has come up before and really isn&#8217;t all that new of an issue. </p>
<p>First, is this a loss of soveriengty to non-U.S. F-35 users? You bet it is. The countries that signed on for the F-35 knew this for a long time. It is part of the agreement. Not only that but the U.S. will have all the access they need to the embedded logistics and maintenance metrics for every mission. This gives LM knowns for not only better supporting the customer but to have a large advantage for any replacement down the line. This is great metrics for future sales.</p>
<p>But it goes further than deskilling home industry and loss of soveignty. </p>
<p>The whole idea is that everyone goes to war with the same jet and just as important the same software version maintained to the same standard. Don’t like it? Buy another jet. You sign up for the program that is what you get. And within reason it makes a lot of sense as long as undue advantage isn’t taken as mentioned above.</p>
<p>But there is more. That is security and what defines safely exportable U.S. technology. Buy letting just anyone have access to the software, one has better knowledge to the method of the madness that makes up the predictive surviability in the aircraft. That is in part those expanding and deminishing threat circles on the display showing an enemy emitter and how much exposure your low observables can tollerate before you are seen by the enemy. </p>
<p>Keeping the software closed-access is how the F-35 can be allowed to be exported within the confines of U.S. law. <a href="http://www.military.com/features/0,15240,156400,00.html">As this article explains</a>, while there may not be different F-35 variants for different countries based on “their requirements”, a case can be made that there are certainly different configurations and not everyone will have an F-35 like the USAF. </p>
<p>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Creating a JSF application in 10 minutes]]></title>
<link>http://numberformat.wordpress.com/2009/11/25/creating-a-jsf-application-in-10-minutes/</link>
<pubDate>Wed, 25 Nov 2009 06:18:29 +0000</pubDate>
<dc:creator>numberformat</dc:creator>
<guid>http://numberformat.wordpress.com/2009/11/25/creating-a-jsf-application-in-10-minutes/</guid>
<description><![CDATA[This page will describe the process of creating a JSF application and running it within 10 minutes. ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This page will describe the process of creating a JSF application and running it within 10 minutes.</p>
<h3>Requirements</h3>
<ul>
<li>Maven 2</li>
</ul>
<h3>Generate the web application</h3>
<p>First we start with a maven archetype</p>
<p>mvn archetype:generate</p>
<p>Choose option 18 which is a (maven-archetype-webapp)</p>
<p>For the group id enter: test</p>
<p>For the artifactId enter: jsfTestWeb</p>
<p>cd to the project directory and modify the pom.xml file. It should look like this&#8230;</p>
<pre class="brush: xml;">
&#60;project xmlns=&#34;http://maven.apache.org/POM/4.0.0&#34; xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
	xsi:schemaLocation=&#34;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&#34;&#62;
	&#60;modelVersion&#62;4.0.0&#60;/modelVersion&#62;
	&#60;groupId&#62;test&#60;/groupId&#62;
	&#60;artifactId&#62;jsfTestWeb&#60;/artifactId&#62;
	&#60;packaging&#62;war&#60;/packaging&#62;
	&#60;version&#62;1.0-SNAPSHOT&#60;/version&#62;
	&#60;name&#62;jsfTestWeb Maven Webapp&#60;/name&#62;
	&#60;url&#62;http://maven.apache.org&#60;/url&#62;
	&#60;dependencies&#62;
		&#60;dependency&#62;
			&#60;groupId&#62;junit&#60;/groupId&#62;
			&#60;artifactId&#62;junit&#60;/artifactId&#62;
			&#60;version&#62;3.8.1&#60;/version&#62;
			&#60;scope&#62;test&#60;/scope&#62;
		&#60;/dependency&#62;
		&#60;dependency&#62;
			&#60;groupId&#62;javax.faces&#60;/groupId&#62;
			&#60;artifactId&#62;jsf-api&#60;/artifactId&#62;
			&#60;version&#62;1.2_02&#60;/version&#62;
		&#60;/dependency&#62;
		&#60;dependency&#62;
			&#60;groupId&#62;javax.faces&#60;/groupId&#62;
			&#60;artifactId&#62;jsf-impl&#60;/artifactId&#62;
			&#60;version&#62;1.2-b19&#60;/version&#62;
		&#60;/dependency&#62;
		&#60;dependency&#62;
			&#60;groupId&#62;javax.servlet&#60;/groupId&#62;
			&#60;artifactId&#62;jstl&#60;/artifactId&#62;
			&#60;version&#62;1.1.2&#60;/version&#62;
		&#60;/dependency&#62;
		&#60;dependency&#62;
			&#60;groupId&#62;taglibs&#60;/groupId&#62;
			&#60;artifactId&#62;standard&#60;/artifactId&#62;
			&#60;version&#62;1.1.2&#60;/version&#62;
		&#60;/dependency&#62;
	&#60;/dependencies&#62;
	&#60;build&#62;
		&#60;finalName&#62;jsfTestWeb&#60;/finalName&#62;
		&#60;plugins&#62;
			&#60;plugin&#62;
				&#60;groupId&#62;org.mortbay.jetty&#60;/groupId&#62;
				&#60;artifactId&#62;jetty-maven-plugin&#60;/artifactId&#62;
			&#60;/plugin&#62;
		&#60;/plugins&#62;
	&#60;/build&#62;
&#60;/project&#62;
</pre>
<p>Modify the WEB-INF/web.xml</p>
<pre class="brush: xml;">
&#60;!DOCTYPE web-app PUBLIC
 &#34;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&#34;
 &#34;http://java.sun.com/dtd/web-app_2_3.dtd&#34; &#62;

&#60;web-app&#62;
  &#60;display-name&#62;Archetype Created Web Application&#60;/display-name&#62;

  &#60;servlet&#62;
  	&#60;servlet-name&#62;Faces Servlet&#60;/servlet-name&#62;
  	&#60;servlet-class&#62;javax.faces.webapp.FacesServlet&#60;/servlet-class&#62;
  	&#60;load-on-startup&#62;1&#60;/load-on-startup&#62;
  &#60;/servlet&#62;

  &#60;servlet-mapping&#62;
  	&#60;servlet-name&#62;Faces Servlet&#60;/servlet-name&#62;
  	&#60;url-pattern&#62;*.faces&#60;/url-pattern&#62;
  &#60;/servlet-mapping&#62;

  &#60;welcome-file-list&#62;
  	&#60;welcome-file&#62;index.jsp&#60;/welcome-file&#62;
  &#60;/welcome-file-list&#62;

&#60;/web-app&#62;
</pre>
<p>Create a WEB-INF/faces-config.xml</p>
<pre class="brush: xml;">
&#60;?xml version='1.0' encoding='UTF-8'?&#62;
&#60;faces-config xmlns=&#34;http://java.sun.com/xml/ns/javaee&#34;
              xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
              xsi:schemaLocation=&#34;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&#34;
              version=&#34;1.2&#34;&#62;

&#60;managed-bean&#62;
	&#60;managed-bean-name&#62;message&#60;/managed-bean-name&#62;
	&#60;managed-bean-class&#62;java.lang.String&#60;/managed-bean-class&#62;
	&#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
&#60;/managed-bean&#62;
&#60;managed-bean&#62;
	&#60;managed-bean-name&#62;messageModel&#60;/managed-bean-name&#62;
	&#60;managed-bean-class&#62;test.MessageModel&#60;/managed-bean-class&#62;
	&#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
&#60;/managed-bean&#62;
&#60;/faces-config&#62;
</pre>
<p>Create a jsp helloWorld.jsp</p>
<pre class="brush: xml;">
&#60;!DOCTYPE html
PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34;
&#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;%@ page contentType=&#34;text/html;charset=UTF-8&#34; language=&#34;java&#34; %&#62;
&#60;%@ taglib prefix=&#34;f&#34; uri=&#34;http://java.sun.com/jsf/core&#34; %&#62;
&#60;%@ taglib prefix=&#34;h&#34; uri=&#34;http://java.sun.com/jsf/html&#34; %&#62;

&#60;f:view&#62;
    &#60;html&#62;
    &#60;head&#62;
        &#60;title&#62;Hello World JSF Example&#60;/title&#62;
    &#60;/head&#62;
    &#60;body&#62;
    &#60;h:form&#62;
		&#60;p&#62;This is a simple hello world page using Faces.&#60;/p&#62;
		&#60;p&#62;Enter your message here: &#60;br/&#62;
		&#60;h:inputText valueChangeListener=&#34;#{messageModel.printMessage}&#34; value=&#34;#{message}&#34; size=&#34;35&#34;/&#62;&#60;/p&#62;
		&#60;h:commandButton value=&#34;Submit&#34; action=&#34;submit&#34;/&#62;
    &#60;/h:form&#62;
    &#60;/body&#62;
    &#60;/html&#62;
&#60;/f:view&#62;
</pre>
<h3>Create a managed Bean</h3>
<p>src/main/java/test.MessageModel.java</p>
<pre class="brush: java;">
package test;

import javax.faces.event.ValueChangeEvent;

public class MessageModel {
	public void printMessage(ValueChangeEvent e) {
		System.out.println(&#34;old value was: &#34; + e.getOldValue());
		System.out.println(&#34;new value is: &#34; + e.getNewValue());
	}
}
</pre>
<h3>Run the JSF application</h3>
<p>Save all files and run the application in jetty.</p>
<p>mvn jetty:run</p>
<p>The application should come up when you point your browser to http://localhost:8080</p>
<p>Type in some text and you should see some output on the console window.</p>
<p>Right click on the page and click view source. You will notice JSF generated code.</p>
<h3>That&#8217;s all for Now!</h3>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[JSF y su valor añadido]]></title>
<link>http://fetishcode.wordpress.com/2009/11/24/jsf-y-su-valor-anadido/</link>
<pubDate>Tue, 24 Nov 2009 08:52:36 +0000</pubDate>
<dc:creator>fetishcode</dc:creator>
<guid>http://fetishcode.wordpress.com/2009/11/24/jsf-y-su-valor-anadido/</guid>
<description><![CDATA[Que nos ofrece un framework de desarrollo como JSF. Estos son algunos de los puntos calves que nos o]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Que nos ofrece un framework de desarrollo como <a href="http://java.sun.com/j2ee/javaserverfaces/">JSF</a>. Estos son algunos de los puntos calves que nos ofrece afrontar nuestros desarrollos con JSF como base.</p>
<ul>
<li> <strong>Modelo de componentes reutilizables</strong></li>
<li>Control de datos asociados a cada componente de interfaz</li>
<li>Focalizar los esfuerzos en la aplicación</li>
<li>Gestion de mensajes</li>
<li>Gestion de Errores</li>
<li><strong>Definición de un método para crear nuevos componentes </strong></li>
<li>Separación de la capa de presentación</li>
<li>Diferenciación de roles</li>
<li><strong>Estandarización</strong></li>
<li>Gestión de las navegaciones</li>
<li>Validaciones</li>
</ul>
<p>Independientemente de <strong>JSF</strong>, un framework siempre nos debería aportar</p>
<ul>
<li><strong>Productividad</strong></li>
<li><strong> Best practices y patrones de diseño</strong></li>
<li><strong>Calidad, estructuracion </strong></li>
<li><strong>Mantenibilidad</strong></li>
<li> <strong>Flexibilidad</strong></li>
<li><strong>Apertura en el mercado</strong></li>
</ul>
<p><a href="http://java.sun.com/j2ee/javaserverfaces/"><br />
</a><strong>Mas info:</strong><a href="http://es.wikipedia.org/wiki/Framework"> Framework</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Making a 4 dependent selectonemenu with ajax]]></title>
<link>http://yigitdarcin.wordpress.com/2009/11/23/making-a-4-dependent-selectonemenu-with-ajax/</link>
<pubDate>Sun, 22 Nov 2009 22:30:45 +0000</pubDate>
<dc:creator>yigitdarcin</dc:creator>
<guid>http://yigitdarcin.wordpress.com/2009/11/23/making-a-4-dependent-selectonemenu-with-ajax/</guid>
<description><![CDATA[Hi, if you want to make a 4 dependent selectonemenus with ajax, you can use the following code : and]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hi,</p>
<p>if you want to make a 4 dependent selectonemenus with ajax, you can use the following code :</p>
<p><code>
<p id="selectPlace">
<p>
<p></code></p>
<p>and that is it. The java part is not also easy. you just have getters setters for country,city &#8230;. just do not forget to put  your bean in view scope or session scope.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Charts in JSF using Primefaces]]></title>
<link>http://technicalbrainwave.wordpress.com/2009/11/23/charts-in-jsf-using-primefaces/</link>
<pubDate>Sun, 22 Nov 2009 16:21:19 +0000</pubDate>
<dc:creator>Gift Sam</dc:creator>
<guid>http://technicalbrainwave.wordpress.com/2009/11/23/charts-in-jsf-using-primefaces/</guid>
<description><![CDATA[Introduction In the Previous days the charts can be created in the JSF application with the use of J]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Introduction</strong></p>
<p>In the Previous days the charts can be created in the JSF application with the use of JSF Chart Creator, But now while surfing the net the peoples suggested to get rid of JSF Chart Creator and to focus on Primefaces charts. Definitely I am sure Primefaces provides the easiest ways to create charts components in a JSF application which is based on flash based YUI charts. In this article we are going to construct the most commonly used chart types in a JSF application with the use of Primefaces. Before proceeding to the construction of charts first we need to configure Primefaces for a JSF application. I hope the article <a href="http://technicalbrainwave.wordpress.com/2009/11/07/step-by-step-tutorial-to-setup-primefaces-in-netbeans6-x/" target="_blank">&#8220;Step by step tutorial to setup Primefaces in Netbeans&#8221;</a> would be helpful to do so, and also we should have the prerequisites stated below,</p>
<p><strong>Things You&#8217;ll Need</strong></p>
<ul>
<li>Your Favourite IDE</li>
<li>Tomcat 6.x/Glassfish/Jboss</li>
<li>JDK 1.5 and above</li>
</ul>
<p>I assume that you had configured the primefaces in your favourite IDE and now let us start constructing some of the commonly used charts types.<!--more--> Thanks for the excellent resource provided in the <a href="http://code.google.com/p/primefaces/wiki/Charts" target="_blank">Primefaces wiki</a> and the charts are,</p>
<ol>
<li>Pie Chart</li>
<li>Line Chart</li>
<li>Column Chart</li>
</ol>
<p><strong>Pie Chart</strong></p>
<p>Pie charts are useful for showing relationship (percentage) of parts to a whole. In this example we shall construct a sample page which shows the average page hits of four bloggers A, B, C and D. Let us begin by creating a backing bean for the pie chart, and it requires two backing bean named PieChartBean and PieChartContentBean.</p>
<p><em><strong>PieChartBean.java</strong></em></p>
<p>This backing bean contains the actual data to be feeded in the Pie Chart.</p>
<pre class="brush: css;">
package com.sample.primefaces;

import java.util.ArrayList;
import java.util.List;
/**
 *
 * @author Giftsam
 */
public class PieChartBean
{

 private List&#60;PieChartContentBean&#62; pieChartContentBeanList;

 public PieChartBean()
 {
 pieChartContentBeanList = new ArrayList&#60;PieChartContentBean&#62;();
 pieChartContentBeanList.add(new PieChartContentBean(&#34;Blogger A&#34;, 192));
 pieChartContentBeanList.add(new PieChartContentBean(&#34;Blogger B&#34;, 762));
 pieChartContentBeanList.add(new PieChartContentBean(&#34;Blogger C&#34;, 245));
 pieChartContentBeanList.add(new PieChartContentBean(&#34;Blogger D&#34;, 661));
 }

 /**
 * @return the pieChartContentBeanList
 */
 public List&#60;PieChartContentBean&#62; getPieChartContentBeanList()
 {
 return pieChartContentBeanList;
 }
}
</pre>
<p><em><strong>PieChartContentBean.java</strong></em></p>
<p>This class contains the details of the four bloggers A, B, C and D, (ie) the blogger name and the number of page hits values which is to be feeded by PieChartBean Class.</p>
<pre class="brush: css;">

package com.sample.primefaces;
/**
 *
 * @author Giftsam
 */
public class PieChartContentBean
{
 private String bloggerName;
 private int numberOfHits;

 public PieChartContentBean()
 {
 }

 public PieChartContentBean(String bloggerName, int numberOfHits)
 {
 this.bloggerName = bloggerName;
 this.numberOfHits = numberOfHits;
 }

 /**
 * @return the bloggerName
 */
 public String getBloggerName()
 {
 return bloggerName;
 }

 /**
 * @param bloggerName the bloggerName to set
 */
 public void setBloggerName(String bloggerName)
 {
 this.bloggerName = bloggerName;
 }

 /**
 * @return the numberOfHits
 */
 public int getNumberOfHits()
 {
 return numberOfHits;
 }

 /**
 * @param numberOfHits the numberOfHits to set
 */
 public void setNumberOfHits(int numberOfHits)
 {
 this.numberOfHits = numberOfHits;
 }
}
</pre>
<p>Now we had created the Data for the chart and next we need a write a managed bean for PieChartBean class in the faces-config.xml.</p>
<pre class="brush: css;">

&#60;managed-bean&#62;
 &#60;managed-bean-name&#62;PieChartBean&#60;/managed-bean-name&#62;
 &#60;managed-bean-class&#62;com.sample.primefaces.PieChartBean&#60;/managed-bean-class&#62;
 &#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
 &#60;/managed-bean&#62;
</pre>
<p>And finally we need to create a JSP document. Let us name the JSP document as pieChart.jsp and it contains the following code,</p>
<p><em><strong>pieChart.jsp</strong></em></p>
<pre class="brush: css;">

&#60;%--
 Document   : pieChart
 Author     : Giftsam
--%&#62;
&#60;%@ page language=&#34;java&#34; contentType=&#34;text/html; charset=ISO-8859-1&#34;
pageEncoding=&#34;ISO-8859-1&#34;%&#62;
&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/html&#34; prefix=&#34;h&#34;%&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/core&#34; prefix=&#34;f&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;
&#60;%@ taglib uri=&#34;http://primefaces.prime.com.tr/ui&#34; prefix=&#34;p&#34; %&#62;

&#60;f:view&#62;
 &#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62;
 &#60;title&#62;PieChart&#60;/title&#62;
 &#60;p:resources/&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form&#62;
  &#60;p:pieChart value=&#34;#{PieChartBean.pageHitBeanList}&#34; var=&#34;pieChartContentBean&#34;
 categoryField=&#34;#{pieChartContentBean.bloggerName}&#34; dataField=&#34;#{pieChartContentBean.numberOfHits}&#34;
 /&#62;
  &#60;/h:form&#62;
 &#60;/body&#62;
 &#60;/html&#62;
&#60;/f:view&#62;
</pre>
<p><em><strong>Attributes Used</strong></em></p>
<p>Attributes used for the above pie chart are categoryField, which is used to specify the pie section of the chart and the dataField holds the value of the corresponding categoryField. Now the construction of pie chart is completed and let us have look on the snap of our chart.</p>
<p><em><strong>Pie Chart Snap</strong></em></p>
<p><a href="http://technicalbrainwave.wordpress.com/files/2009/11/piechart.jpg"><img title="PieChart " src="http://technicalbrainwave.wordpress.com/files/2009/11/piechart.jpg" alt="" width="350" height="296" /></a></p>
<p>Now its time to move on to construct the next chart type (ie) the line chart.</p>
<p><strong>Line Chart</strong></p>
<p>Line charts are to display trends over a particular timeframe. In this example we shall construct a sample page which shows the students pass and the fail percentages of two class A and B. Let us begin by creating a backing bean for the line chart, and it requires two backing bean named ChartBean and ChartContentBean.</p>
<p><em><strong>ChartBean.java</strong></em></p>
<p>This backing bean contains the actual data to be feed in the Line Chart.</p>
<pre class="brush: css;">
package com.sample.primefaces;

import java.util.ArrayList;
import java.util.List;
/**
 *
 * @author Giftsam
 */
public class ChartBean
{

 private List&#60;ChartContentBean&#62; chartContentbeanList;

 public ChartBean()
 {
 chartContentbeanList = new ArrayList&#60;ChartContentBean&#62;();
 chartContentbeanList.add(new ChartContentBean(2006, 25, 20));
 chartContentbeanList.add(new ChartContentBean(2007, 60, 50));
 chartContentbeanList.add(new ChartContentBean(2008, 40, 65));
 chartContentbeanList.add(new ChartContentBean(2009, 70, 60));
 }

 /**
 * @return the chartContentbeanList
 */
 public List&#60;ChartContentBean&#62; getChartContentbeanList()
 {
 return chartContentbeanList;
 }
</pre>
<p><em><strong>LineChartContentBean.java</strong></em></p>
<p>This class contains the pass and failed percentage details of  two classes A and B.</p>
<pre class="brush: css;">

package com.sample.primefaces;
/**
 *
 * @author Giftsam
 */
public class ChartContentBean
{
 private int year;
 private int passPercentage;
 private int failedPercentage;

 public ChartContentBean()
 {
 }

 public ChartContentBean(int year, int passPercentage, int failedPercentage)
 {
 this.year = year;
 this.passPercentage = passPercentage;
 this.failedPercentage = failedPercentage;
 }

 /**
 * @return the year
 */
 public int getYear()
 {
 return year;
 }

 /**
 * @param year the year to set
 */
 public void setYear(int year)
 {
 this.year = year;
 }

 /**
 * @return the passPercentage
 */
 public int getPassPercentage()
 {
 return passPercentage;
 }

 /**
 * @param passPercentage the passPercentage to set
 */
 public void setPassPercentage(int passPercentage)
 {
 this.passPercentage = passPercentage;
 }

 /**
 * @return the failedPercentage
 */
 public int getFailedPercentage()
 {
 return failedPercentage;
 }

 /**
 * @param failedPercentage the failedPercentage to set
 */
 public void setFailedPercentage(int failedPercentage)
 {
 this.failedPercentage = failedPercentage;
 }
}
</pre>
<p>Now we had created the Data for the line chart and next we need to write a managed bean for the ChartBean class in the faces-config.xml.</p>
<pre class="brush: css;">
&#60;managed-bean&#62;
 &#60;managed-bean-name&#62;ChartBean&#60;/managed-bean-name&#62;
 &#60;managed-bean-class&#62;com.sample.primefaces.LineChartBean&#60;/managed-bean-class&#62;
 &#60;managed-bean-scope&#62;session&#60;/managed-bean-scope&#62;
 &#60;/managed-bean&#62;
</pre>
<p>Only thing left to construct line chart is, we need to create a JSP document. Let us name the JSP document as lineChart.jsp and it contains the following code,</p>
<p><em><strong>lineChart.jsp</strong></em></p>
<pre class="brush: css;">
&#60;%--
 Document   : lineChart
 Author     : Giftsam
--%&#62;
&#60;%@ page language=&#34;java&#34; contentType=&#34;text/html; charset=ISO-8859-1&#34;
 pageEncoding=&#34;ISO-8859-1&#34;%&#62;
&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/html&#34; prefix=&#34;h&#34;%&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/core&#34; prefix=&#34;f&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;
&#60;%@ taglib uri=&#34;http://primefaces.prime.com.tr/ui&#34; prefix=&#34;p&#34; %&#62;

&#60;f:view&#62;
 &#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62;
 &#60;title&#62;LineChart&#60;/title&#62;
 &#60;p:resources/&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form&#62;
 &#60;p:lineChart value=&#34;#{ChartBean.chartContentbeanList}&#34; var=&#34;chartContentBean&#34;
 xfield=&#34;#{chartContentBean.year}&#34;&#62;
 &#60;p:chartSeries label=&#34;Class A&#34; value=&#34;#{chartContentBean.passPercentage}&#34; /&#62;
 &#60;p:chartSeries label=&#34;Class B&#34; value=&#34;#{chartContentBean.failedPercentage}&#34; /&#62;
 &#60;/p:lineChart&#62;
 &#60;/h:form&#62;
 &#60;/body&#62;
 &#60;/html&#62;
&#60;/f:view&#62;
</pre>
<p><em><strong>Attributes Used</strong></em></p>
<p>Attributes used for the line chart are xField, which is used to denote the x-axis of the chart and the tag &#60;p:chartSeries&#62; is used to construct the lines for the chart. Now the construction of Column Chart is completed and let us have look on the snap of our chart.</p>
<p><strong>Line Chart Snap</strong></p>
<p><a href="http://technicalbrainwave.wordpress.com/files/2009/11/lchart.jpg"><img title="LineChart" src="http://technicalbrainwave.wordpress.com/files/2009/11/lchart.jpg" alt="" width="372" height="290" /></a></p>
<p>So far we had constructed line chart and next let us learn how to construct a column chart.</p>
<p><strong>Column Chart</strong></p>
<p>Column chart contains vertical Bars which emphasize the differences and values across multiple categories. Now for column chart let us conjure the same backing bean which we invoked for lineChart((ie) the same example). Only thing we need to create a JSP document. Let us name the JSP document as columnChart.jsp and it contains the following code,</p>
<p><em><strong>columnChart.jsp</strong></em></p>
<pre class="brush: css;">

&#60;%--
 Document   : columnChart
 Author     : Giftsam
--%&#62;
&#60;%@ page language=&#34;java&#34; contentType=&#34;text/html; charset=ISO-8859-1&#34;
 pageEncoding=&#34;ISO-8859-1&#34;%&#62;
&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/html&#34; prefix=&#34;h&#34;%&#62;
&#60;%@ taglib uri=&#34;http://java.sun.com/jsf/core&#34; prefix=&#34;f&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34;%&#62;
&#60;%@ taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;
&#60;%@ taglib uri=&#34;http://primefaces.prime.com.tr/ui&#34; prefix=&#34;p&#34; %&#62;

&#60;f:view&#62;
 &#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62;
 &#60;title&#62;ColumnChart&#60;/title&#62;
 &#60;p:resources/&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form&#62;
 &#60;p:columnChart value=&#34;#{ChartBean.chartContentbeanList}&#34; var=&#34;chartContentBean&#34; xfield=&#34;#{chartContentBean.year}&#34;&#62;
 &#60;p:chartSeries label=&#34;Class A&#34; value=&#34;#{chartContentBean.passPercentage}&#34; /&#62;
 &#60;p:chartSeries label=&#34;Class B&#34; value=&#34;#{chartContentBean.failedPercentage}&#34; /&#62;
 &#60;/p:columnChart&#62;
 &#60;/h:form&#62;
 &#60;/body&#62;
 &#60;/html&#62;
&#60;/f:view&#62;
</pre>
<p><em><strong>Attributes Used</strong></em></p>
<p>Attributes used for the column chart are xField, which is used to denote the x-axis of the chart and the tag &#60;p:chartSeries&#62; is used to construct the verticle bars for the chart. Now the construction of column chart is completed and let us have look on the snap of our chart,</p>
<p><em><strong>Column Chart Snap</strong></em></p>
<p><a href="http://technicalbrainwave.wordpress.com/files/2009/11/columnchart.jpg"><img title="ColumnChart" src="http://technicalbrainwave.wordpress.com/files/2009/11/columnchart.jpg" alt="" width="367" height="296" /></a></p>
<p>Thats all folks. I hope this article clearly explains the construction of commonly used charts required for our application. If you find this article is useful for you, dont forget to give me your valuable comments. Have a joyous code day.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[NUEVO BLOG]]></title>
<link>http://mundobyte.wordpress.com/2009/11/22/nuevo-blog/</link>
<pubDate>Sun, 22 Nov 2009 03:50:48 +0000</pubDate>
<dc:creator>windoctor</dc:creator>
<guid>http://mundobyte.wordpress.com/2009/11/22/nuevo-blog/</guid>
<description><![CDATA[ATENCIÓN!!!! NUEVO BLOG EN UN HOSTING JAVA. RECIEN LO VOY A COMENZAR, ASÍ QUE VISITENLO SEGUIDO PARA]]></description>
<content:encoded><![CDATA[ATENCIÓN!!!! NUEVO BLOG EN UN HOSTING JAVA. RECIEN LO VOY A COMENZAR, ASÍ QUE VISITENLO SEGUIDO PARA]]></content:encoded>
</item>
<item>
<title><![CDATA[JSF and Richfaces configuration in Netbeans 6.x]]></title>
<link>http://shunmugakrishna.wordpress.com/2009/11/22/jsf-and-richfaces-configurations-in-netbeans6-x/</link>
<pubDate>Sun, 22 Nov 2009 02:13:45 +0000</pubDate>
<dc:creator>shunmugakrishna</dc:creator>
<guid>http://shunmugakrishna.wordpress.com/2009/11/22/jsf-and-richfaces-configurations-in-netbeans6-x/</guid>
<description><![CDATA[Introduction: JSF (Java Server Faces) is an java based  framework  for developing web application . ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Introduction:</strong></p>
<p>JSF (Java Server Faces) is an java based  framework  for developing web application . Also component library can be easily incorporated in to the JSF Application. I have listed the most used components libraries by the developers in the below.</p>
<ul>
<li><a href="http://livedemo.exadel.com/richfaces-demo/index.jsp" target="_blank">JBoss Richfaces</a></li>
<li><a href="https://woodstock.dev.java.net/Documentation.htm" target="_blank">Woodstock</a></li>
<li><a href="http://www.icefaces.org/main/demos/" target="_blank">Icefaces</a></li>
<li><a href="http://myfaces.apache.org/tomahawk/index.html" target="_blank">MyFaces Tomahawk</a></li>
<li><a href="http://myfaces.apache.org/tobago/index.html" target="_blank">MyFaces Tobaco</a></li>
<li><a href="http://primefaces.prime.com.tr/en/" target="_blank">Prime Faces</a></li>
<li><a href="http://www.jscape.com/webgalileofaces/" target="_blank">WebGalileo Faces</a></li>
<li><a href="http://openfaces.org/" target="_blank">Open Faces</a></li>
<li><a href="http://vaadin.com/home">Vaadin</a></li>
</ul>
<p>But this articles explains the Installation guidelines of Richfaces with JSF in Netbeans 6.x. Additionally learn how to create a hello world application in JSF using Richfaces. I assume that you have the requirements which I had mentioned below</p>
<p><strong>Requirements:</strong></p>
<ul>
<li>IDE – Netbeans 6.x</li>
<li>Tomcat 6.x/Glassfish/Jboss</li>
<li>JDK 1.5 and above</li>
</ul>
<p><strong>Configuration Steps:</strong></p>
<p>Configuring Richfaces with JSF application in Netbeans6.x can be accomplished by 4 easy steps <!--more-->they are,</p>
<ol>
<li>Create the web application project</li>
<li>Required jars(Library)</li>
<li>Deployment descriptor configuration(web.xml)</li>
<li>Hello world JSP page</li>
</ol>
<p><strong>Create the web application project:</strong></p>
<p>First Let us create the web application project in JSF, by clicking the File in the menu and select New Project in the Netbeans6.x, I have stated an image for your clear understandings,</p>
<p><a href="http://shunmugakrishna.files.wordpress.com/2009/11/untitled1.jpg"><img title="Project Creation First Image" src="http://shunmugakrishna.files.wordpress.com/2009/11/untitled1.jpg?w=500&#038;h=342#38;h=342" alt="" width="500" height="342" /></a></p>
<p>Once this window appears choose web application and click next. Now you will have the window which I had mentioned below</p>
<p><a href="http://shunmugakrishna.files.wordpress.com/2009/11/projectname4.jpg"><img title="Project Creation Second Image" src="http://shunmugakrishna.files.wordpress.com/2009/11/projectname4.jpg?w=500&#038;h=342#38;h=342" alt="" width="500" height="342" /></a></p>
<p>In the preceding window, Let us name and location of the project. Since my article explains the creation of  Hello world Application I have given the Name as HelloWorld and then click next. Now you will have the window which I had mentioned below</p>
<p><a href="http://shunmugakrishna.files.wordpress.com/2009/11/chooseserver4.jpg"><img title="Project Creation Third Image" src="http://shunmugakrishna.files.wordpress.com/2009/11/chooseserver4.jpg?w=500&#038;h=342#38;h=342" alt="" width="500" height="342" /></a></p>
<p>In the preceding window, Let us select the server(Your favorite Server) and click next</p>
<p><a href="http://shunmugakrishna.files.wordpress.com/2009/11/framework-choosen1.jpg"><img title="Project Creation Fourth Image" src="http://shunmugakrishna.files.wordpress.com/2009/11/framework-choosen1.jpg?w=500&#038;h=342#38;h=342" alt="" width="500" height="342" /></a></p>
<p>In the preceding window, Let us select the JavaServerFaces framework from the check box and click finish. So far we had created a JSF web application project in Netbeans6.x and next let us configure the Jar files for our web application.</p>
<p><strong>Required jars(Library)</strong></p>
<p><a href="http://www.jboss.org/richfaces/download/archive.html" target="_blank">Click here</a> to download the following required latest richfaces jars</p>
<ul>
<li>richfaces-api-3.3.1.GA.jar</li>
<li>richfaces-impl-3.3.1.GA.jar</li>
<li>richfaces-ui-3.3.1.GA.jar</li>
</ul>
<p><strong>Deployment descriptor(DD) configuration(web.xml):</strong></p>
<pre class="brush: css;">

&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;web-app version=&#34;2.5&#34; xmlns=&#34;http://java.sun.com/xml/ns/javaee&#34; xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34; xsi:schemaLocation=&#34;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#34;&#62;
 &#60;context-param&#62;
 &#60;param-name&#62;com.sun.faces.verifyObjects&#60;/param-name&#62;
 &#60;param-value&#62;false&#60;/param-value&#62;
 &#60;/context-param&#62;
 &#60;context-param&#62;
 &#60;param-name&#62;com.sun.faces.validateXml&#60;/param-name&#62;
 &#60;param-value&#62;true&#60;/param-value&#62;
 &#60;/context-param&#62;
 &#60;context-param&#62;
 &#60;param-name&#62;javax.faces.STATE_SAVING_METHOD&#60;/param-name&#62;
 &#60;param-value&#62;client&#60;/param-value&#62;
 &#60;/context-param&#62;
 &#60;servlet&#62;
 &#60;servlet-name&#62;Faces Servlet&#60;/servlet-name&#62;
 &#60;servlet-class&#62;javax.faces.webapp.FacesServlet&#60;/servlet-class&#62;
 &#60;load-on-startup&#62;1&#60;/load-on-startup&#62;
 &#60;/servlet&#62;
 &#60;servlet-mapping&#62;
 &#60;servlet-name&#62;Faces Servlet&#60;/servlet-name&#62;
 &#60;url-pattern&#62;/faces/*&#60;/url-pattern&#62;
 &#60;/servlet-mapping&#62;
 &#60;session-config&#62;
 &#60;session-timeout&#62;
 30
 &#60;/session-timeout&#62;
 &#60;/session-config&#62;
 &#60;welcome-file-list&#62;
 &#60;welcome-file&#62;index.jsp&#60;/welcome-file&#62;
 &#60;/welcome-file-list&#62;

 &#60;!-- Rich Faces configuration --&#62;

 &#60;!-- Specify the skin name --&#62;
 &#60;context-param&#62;
 &#60;param-name&#62;org.ajax4jsf.SKIN&#60;/param-name&#62;
 &#60;param-value&#62;laguna&#60;/param-value&#62;
 &#60;/context-param&#62;

 &#60;!--Rich faces skin apply for the standard jsf component also--&#62;
 &#60;context-param&#62;
 &#60;param-name&#62;org.richfaces.CONTROL_SKINNING&#60;/param-name&#62;
 &#60;param-value&#62;enable&#60;/param-value&#62;
 &#60;/context-param&#62;

 &#60;filter&#62;
 &#60;display-name&#62;RichFaces Filter&#60;/display-name&#62;
 &#60;filter-name&#62;Ajax4jsf&#60;/filter-name&#62;
 &#60;filter-class&#62;org.ajax4jsf.Filter&#60;/filter-class&#62;
 &#60;/filter&#62;

 &#60;filter-mapping&#62;
 &#60;filter-name&#62;Ajax4jsf&#60;/filter-name&#62;
 &#60;servlet-name&#62;Faces Servlet&#60;/servlet-name&#62;
 &#60;dispatcher&#62;REQUEST&#60;/dispatcher&#62;
 &#60;dispatcher&#62;FORWARD&#60;/dispatcher&#62;
 &#60;dispatcher&#62;INCLUDE&#60;/dispatcher&#62;
 &#60;/filter-mapping&#62;

 &#60;!--End of rich Faces configuration --&#62;

&#60;/web-app&#62;
</pre>
<p>Setup process of Primefaces in Netbeans6.x has been completed and now let us create a hello world page using Richfaces UI components. The following code should be conjured to do so,</p>
<p><strong>Hello world JSP page:</strong></p>
<pre class="brush: css;">

&#60;%--
 Document   : helloWorld
 Created on : Nov 22, 2009, 4:07:09 PM
 Author     : shunmuga
--%&#62;

&#60;%@page contentType=&#34;text/html&#34; pageEncoding=&#34;UTF-8&#34;%&#62;
&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;
 &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62;

&#60;%@taglib uri=&#34;http://java.sun.com/jsf/html&#34; prefix=&#34;h&#34; %&#62;
&#60;%@taglib uri=&#34;http://java.sun.com/jsf/core&#34; prefix=&#34;f&#34; %&#62;
&#60;%@taglib uri=&#34;http://richfaces.org/a4j&#34; prefix=&#34;a4j&#34; %&#62;
&#60;%@taglib uri=&#34;http://richfaces.org/rich&#34; prefix=&#34;rich&#34;%&#62;

&#60;f:view&#62;
&#60;html&#62;
 &#60;head&#62;
 &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62;
 &#60;title&#62;JSP Page&#60;/title&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h:form&#62;
 &#60;rich:panel style=&#34;position: relative; width: 400px;height: 150px;&#34;&#62;
 &#60;f:facet name=&#34;header&#34;&#62;
 &#60;h:outputText value=&#34;Hello world &#34;/&#62;

 &#60;/f:facet&#62;
 &#60;h:outputText value=&#34;Welcome to rich faces ...&#34;/&#62;
 &#60;/rich:panel&#62;
 &#60;/h:form&#62;

 &#60;/body&#62;
&#60;/html&#62;
&#60;/f:view&#62;
</pre>
<p>By invoking the above code, we had created a Hello World demo application which contains a Richfaces panel, Now let us have a look on the snap of our Hello World application.</p>
<p><strong>Screen Shot:</strong></p>
<p><a href="http://shunmugakrishna.wordpress.com/files/2009/11/sample2.jpg"><img class="alignnone size-full wp-image-70" title="sample" src="http://shunmugakrishna.wordpress.com/files/2009/11/sample2.jpg" alt="" width="417" height="168" /></a></p>
<p style="text-align:left;">If you find this article is useful to you dont forget to give your valuable comments. Have a joyous day.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ Ansaldo STS measures and looks after the satisfaction of the users ]]></title>
<link>http://scriptforall.wordpress.com/2009/11/21/ansaldo-sts-measures-and-looks-after-the-satisfaction-of-the-users/</link>
<pubDate>Sat, 21 Nov 2009 10:30:35 +0000</pubDate>
<dc:creator>kostland</dc:creator>
<guid>http://scriptforall.wordpress.com/2009/11/21/ansaldo-sts-measures-and-looks-after-the-satisfaction-of-the-users/</guid>
<description><![CDATA[tude of case &#8211; the Italian group of the railway sector made of the ITIL its standard for the m]]></description>
<content:encoded><![CDATA[tude of case &#8211; the Italian group of the railway sector made of the ITIL its standard for the m]]></content:encoded>
</item>
<item>
<title><![CDATA[First "naval" JSF lands at NAS Patuxent River]]></title>
<link>http://cencio4.wordpress.com/2009/11/21/first-naval-jsf-lands-at-nas-patuxent-river/</link>
<pubDate>Sat, 21 Nov 2009 01:00:59 +0000</pubDate>
<dc:creator>David Cenciotti</dc:creator>
<guid>http://cencio4.wordpress.com/2009/11/21/first-naval-jsf-lands-at-nas-patuxent-river/</guid>
<description><![CDATA[During my visit to the USS Nimitz in the Indian Ocean last month, I had the opportunity to see the B]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>During my visit to the USS Nimitz in the Indian Ocean last month, I had the opportunity to see the Boeing F/A-18E/F Super Hornets in action. The Super Hornet is a 4.5+ generation naval multirole aircraft that was delivered to the US Navy in 1999 to replace the F-14, the S-3 and, in the long term, the F/A-18C and D Hornet.<br />
Even if the &#8220;Rhino&#8221; (as the aircraft has been dubbed to distinguish it from the &#8220;legacy Hornet&#8221;) is the most advanced aircraft in the USN inventory, its replacement is already flying and undertaking flight testing: on Nov. 15, the first Lockheed F-35B Joint Strike Fighter (JSF) landed at Naval Air Station (NAS) Patuxent River, Md. The test aircraft, known as BF-1, after departing from Lockheed facility in Fort Worth, landed at Pax River after a stop in Dobbins Air Force Base, Ga.<br />
BF-1 is the first of five test F-35B STOVL (Short Take-Off Vertical Landing) variants to be assigned to the air station. BF-2 is expected to arrive by the end of this year and BF-3 will follow shortly behind that, Lockheed spokesman John Kent said. The air station also will be home to three Navy carrier test variants. Before the aircraft can complete its first vertical landing, it must go through a transition phase. When regular airplanes fly, lift is created from the wing. But for hovering jets such as the F-35B, it is created from the jet itself. The transition phase is expected to include a series of flights, during which the aircraft will practice slowing down and transitioning lift from the wing to the jet — a critical step before an actual STOVL flight. Additional testing will include flying with different weight loads and ordnance payloads, according to a Marine release. “I’m anxious to have our engineers, our test pilots and our operators get their hands on this jet, and then see what we can do to turn test points and sorties at a rapid rate during the coming months,” said Lt. Gen. George J. Trautman, the deputy commandant for aviation, in a release. Eventually the Joint Strike Fighter will replace the F/A-18 Hornet, AV-8B Harrier, and the EA-6B Prowler. Marine Fighter/Attack Training Squadron-501, the first squadron that will train Marine JSF pilots and maintainers, is expected to stand up at Eglin Air Force Base, Fla., in April 2010 as part of the Joint Integrated Training Center. The first operational squadron will stand up in 2012. Even the Marina Militare (Italian Navy) is expeceted to receive 22 naval JSF that will replace the AV-8B+ Harrier and will operate from the new Italian aircraft carrier <a href="http://cencio4.wordpress.com/tag/cavour/">Cavour</a> (that can accomodate 8 &#8211; 10 F-35B).</p>
<p><em>An F/A-18F of the VFA-41 and an E of the VFA-14 overflying USS Nimitz (courtesy USS Nimitz)</em><br />
<a href="http://i226.photobucket.com/albums/dd80/cenciotti/JSF/254.jpg" target="_blank"><img src="http://i226.photobucket.com/albums/dd80/cenciotti/JSF/254.jpg" border="0" alt="" width="461" height="328" /></a></p>
<p><em>The BF-1 arrives at Patuxent River (Lockheed)</em><br />
<a href="http://i226.photobucket.com/albums/dd80/cenciotti/JSF/BF-1_Pax_Arrival.jpg" target="_blank"><img src="http://i226.photobucket.com/albums/dd80/cenciotti/JSF/BF-1_Pax_Arrival.jpg" border="0" alt="" width="460" height="368" /></a></p>
<p><em>The BF-1 arrives at Patuxent River (Lockheed)</em><br />
<a href="http://i226.photobucket.com/albums/dd80/cenciotti/JSF/BF-1_Pax_Arrival_1__26.jpg" target="_blank"><img src="http://i226.photobucket.com/albums/dd80/cenciotti/JSF/BF-1_Pax_Arrival_1__26.jpg" border="0" alt="" width="460" height="368" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Linkuri utile despre jsf]]></title>
<link>http://jeemaster.wordpress.com/2009/11/20/linkuri-utile-despre-jsf/</link>
<pubDate>Fri, 20 Nov 2009 20:03:50 +0000</pubDate>
<dc:creator>Edi</dc:creator>
<guid>http://jeemaster.wordpress.com/2009/11/20/linkuri-utile-despre-jsf/</guid>
<description><![CDATA[Cum sa accesezi corect un managed-bean programatic gasesti aici , sper sa nu dispara pagina si sa am]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Cum sa accesezi corect un<em> managed-bean</em> programatic gasesti <a href="http://www.javabeat.net/tips/79-accessing-managed-bean-methods-programmatical.html"> aici </a>, sper sa nu dispara pagina si sa am timp sa o adaug pe plogul meu (care de asemenea sper sa nu pateasca nimic);</p>
<p>Alte informatii despre <span style="color:blue;"> hibernate si JSF</span>, cum sa faci o aplicatie jsf si <em>Hibernate in netBeans</em>, tutorial oficial NetBeans <a href="http://netbeans.org/kb/61/web/hibernate-vwp.html">aici</a>, foarte interesant si util.</p>
<p>Totorial Hibernate in <span style="color:blue;">eclipse</span> intuitiv gasiti <a href="http://www.vaannila.com/hibernate/hibernate-example/hibernate-tools-1.html"> aici </a>.</p>
<p>Acelas exemplu oferit de catre JDeveloper gasiti <a href="http://www.oracle.com/technology/pub/articles/vohra_hibernate.html"> aici </a>. JDeveloper este un IDE dezvoltat de catre cei de la Oracle.</p>
<p>O alta idee de aplicatie JSF si Hibernate gasiti si <a href="http://wiki.apache.org/myfaces/Hibernate_And_MyFaces"> aici </a>.</p>
<p>Un tutorial interesant despre Hibernate gasiti <a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/tutorial.html"> aici </a>.</p>
<p>Informatii interesanta despre cum sa golesti o tabela in Hibernate gasesti <a href="https://forum.hibernate.org/viewtopic.php?t=934392">aici</a>.</p>
<p>Un site interesant despre maparile Hibernate gasiti <a href="http://ndpsoftware.com/HibernateMappingCheatSheet.html"> aici </a>. Mi se pare foarte util pt a intelege mai usor si a dezvolta mai rapid o aplicatie.</p>
<p>O versiune unor probleme care implica hibernate si JSF vor fi adaugate mai tarziu pe acest blog.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[title]]></title>
<link>http://scriptforall.wordpress.com/2009/11/19/title-30/</link>
<pubDate>Thu, 19 Nov 2009 13:07:49 +0000</pubDate>
<dc:creator>kostland</dc:creator>
<guid>http://scriptforall.wordpress.com/2009/11/19/title-30/</guid>
<description><![CDATA[Opinion D `expert &#8211; Mutualisation and rduction of the cots militate in favour of the qualit wh]]></description>
<content:encoded><![CDATA[Opinion D `expert &#8211; Mutualisation and rduction of the cots militate in favour of the qualit wh]]></content:encoded>
</item>
<item>
<title><![CDATA[Página de erro com JSF ]]></title>
<link>http://surfzera.wordpress.com/2009/11/18/pagina-de-erro-com-jsf/</link>
<pubDate>Wed, 18 Nov 2009 11:03:19 +0000</pubDate>
<dc:creator>surfzera</dc:creator>
<guid>http://surfzera.wordpress.com/2009/11/18/pagina-de-erro-com-jsf/</guid>
<description><![CDATA[Neste artigo irei mostrar como implementar uma página de erro responsavel por responder a todos os e]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Neste artigo irei mostrar como implementar uma página de erro responsavel por responder a todos os erros inesperados do sistema como (Nullpointer Exception, ClassNotFount, etc&#8230;) ou seja qualquer erro que você não quer que aparece na cara do usuário.</p>
<p>Exemplo:<code><br />
/**<br />
* Classe responsável por tratar erros inesperados do sistema.<br />
*<br />
* @author Fernando Coelho da Silva<br />
*/<br />
public class ExceptionHandler extends ActionListenerImpl implements SimCart {</code></p>
<p>//Endereço da página de Erro.<br />
public static final String erroPage = &#8220;/paginaErro.jsf&#8221;;</p>
<p>@Override<br />
public void processAction(ActionEvent event) {</p>
<p>try {<br />
// Executa o método da classe Pai<br />
super.processAction(event);</p>
<p>} catch (Exception e) {<br />
ExternalContext context1 = FacesContext.getCurrentInstance().getExternalContext();<br />
HttpServletRequest request = (HttpServletRequest) context1.getRequest();</p>
<p>try {<br />
//Redireciona para página de erro apartir do contexto da aplicação.<br />
context1.redirect(request.getContextPath() + erroPage);</p>
<p>} catch (IOException ex) {<br />
logger.error(&#8220;Erro ao tentar redirecionar para a página solicitada: &#8221; + ex.toString());<br />
}<br />
}<br />
}<br />
}</p>
<p>O trecho a ser copiado abaixo se refere a chamada da classe action responsável por chamar a página de erro e deve ser aplicado ao view-handler específico. Neste caso, o ViewHandler utilizado é o do projeto facelets que estou utilizando no projeto em questão.</p>
<p>&#60;application&#62;<br />
&#60;!&#8211; Aplicação do Listener &#8211;&#62;<br />
&#60;action-listener&#62;caixa.sc.simct.util.ExceptionHandler&#60;/action-listener&#62;<br />
&#60;view-handler&#62;com.sun.facelets.FaceletViewHandler&#60;/view-handler&#62;<br />
&#60;locale-config&#62;<br />
&#60;default-locale&#62;pt_BR&#60;/default-locale&#62;<br />
&#60;supported-locale&#62;pt_BR&#60;/supported-locale&#62;<br />
&#60;supported-locale&#62;es_AR&#60;/supported-locale&#62;<br />
&#60;/locale-config&#62;<br />
&#60;/application&#62;<br />
<!-- Aplicação do Listener --></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Core JavaServer Faces]]></title>
<link>http://toebook.wordpress.com/2009/11/18/core-javaserver-faces/</link>
<pubDate>Wed, 18 Nov 2009 06:13:00 +0000</pubDate>
<dc:creator>cnapagoda</dc:creator>
<guid>http://toebook.wordpress.com/2009/11/18/core-javaserver-faces/</guid>
<description><![CDATA[JavaServer Faces (JSF) is quickly emerging as the leading solution for rapid user interface developm]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://i48.tinypic.com/4j27n9.jpg"><img src="http://i48.tinypic.com/4j27n9.jpg" alt="" border="0" /></a>JavaServer Faces (JSF) is quickly emerging as the leading solution for rapid user interface development in Java-based server-side applications. Now, <b><i>Core JavaServer™ Faces</i></b>–the #1 guide to JSF–has been thoroughly updated in this second edition, covering the latest feature enhancements, the powerful Ajax development techniques, and open source innovations that make JSF even more valuable.</p>
<div style="text-align:center;font-weight:bold;">752 pages &#124;Prentice Hall &#124; English&#124; ISBN-10: 0131738860&#124; 22Mb</p>
<p><a href="http://rapidshare.com/files/307642378/Core_JavaServer_Faces.pdf"><span style="color:rgb(0,0,153);">Download</span></a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[JSF demo]]></title>
<link>http://jeemaster.wordpress.com/2009/11/17/jsf-demo/</link>
<pubDate>Tue, 17 Nov 2009 20:14:09 +0000</pubDate>
<dc:creator>Edi</dc:creator>
<guid>http://jeemaster.wordpress.com/2009/11/17/jsf-demo/</guid>
<description><![CDATA[Salutare, în acest articol voi scrie despre JSF (Fava server Faces). Deoarece am descoperit că o apl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Salutare, în acest articol voi scrie despre JSF (Fava server Faces). Deoarece am descoperit că o aplicație mică la prima vedere poate deveni destul de complexă, o voi structura pe 3 capitole. Si anume, baza de date, middle tier și în final partea de view, adică JSF efectiv. Niste linkuri utile despre JSF gasiti aici: <a href="http://www.exadel.com/tutorial/jsf/jsftutorial-kickstart.html">Kickstart</a>, site <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFIntro.html">oficial</a>, articol <a href="http://www.ibm.com/developerworks/library/j-jsf3/"> IBM </a>, tot pe acolo gasiti mai multe articole despre JSF, <a href="http://www.developersbook.com/jsf/jsf-tutorials/jsf-tutorials.php">Developers book</a>. Daca citit toate astea o sa va fie mai usor sa intelegeti aplicatia, sau ati putea chiar sa nu mai cititi de aici.</p>
<p>O aplicație web ar trebui să arate cam asa: <img class="alignright size-full wp-image-23" title="application-architecture" src="http://jeemaster.wordpress.com/files/2009/11/application-architecture.gif" alt="application-architecture" width="700" height="720" /></p>
<p>A se observa unde este Faces servlet si de asemenea faptul ca mai sunt niste tehnologii care permit unei aplicatii sa fie modulara si scalabila.  Avand in vedere ca aplicatia este una pur JSF nivelul business nu poate fi reprezentat de o alta tehnologie. Asa ca o sa il scriem de manutza <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Nu e greu cand ai 2-3 clase, dar de pe la 20 de clasa in sus, ar cam trebui sa folosim un alt framework care sa ne ajute un pic cu gestionarea. Partea de baze de date nu poate fi evitata orice ai face, si aici o sa folosesc <a href="http://www.postgresql.org/">PostgreSQL</a> Este usor de folosit, este gratis, si mai este si performanta (nu ca ar conta pt cateva tabele).</p>
<p>Nu am spus ce face aplicatia, nu mi se pare important atunci cand faci o aplicatie doar pentru a testa un framework, dar pentru logica celor scrise in continuare va spun ca aplicatia o sa &#8220;gestinoneze&#8221; niste scoruri la meciuri.</p>
<p>Sa incepem cu structura aplicatiei, aceasta asrata cam asa :</p>
<p><a href="http://jeemaster.wordpress.com/files/2009/11/game1.png"><img class="alignleft size-full wp-image-28" title="Game" src="http://jeemaster.wordpress.com/files/2009/11/game1.png" alt="" width="238" height="704" /></a></p>
<p>Respirati adanc&#8230; nu e asa de complicat pe cat pare, am pus clasele in multe pachete pt ca</p>
<p>au diferite functii si am vrut sa le regasesc usor, si sa ma obisnuiesc cu o organizare stricta. Imaginati-va cam a avea 10 convertori si 10 validatori&#8230; si asta e doar pt un proiect mediu spre mic <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> . Un tutorial pentru convertori si validatori il puteti vedea <a href="http://www.ibm.com/developerworks/library/j-jsf3/">aici</a>.</p>
<p>Sa incepem cu beanurile, acestea se afla in pacjetul <strong>jsfp</strong> si sunt niste clase cu niste campuri care sunt corespunzatoare cu campurile aferente din tabelele din baza de date. De exemplu in baza de date exista tabela <strong>score</strong>, deci am bean cu acelas nume. Beanul <strong>Score </strong>arata asa:</p>
<pre>package jsfp;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Locale;
import jdba.ScoreService;

public class Score implements Serializable {

    private Long id;
    private Team hoast;
    private Team guest;
    private Integer score1;
    private Integer score2;
    private Calendar date;

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Score)) {
            return false;
        } else {
            Score t = (Score) o;
            if (id != t.getId()) {
                return false;
            } else {
                return true;
            }
        }
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 53 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 53 * hash + (this.hoast != null ? this.hoast.hashCode() : 0);
        hash = 53 * hash + (this.guest != null ? this.guest.hashCode() : 0);
        hash = 53 * hash + (this.score1 != null ? this.score1.hashCode() : 0);
        hash = 53 * hash + (this.score2 != null ? this.score2.hashCode() : 0);
        return hash;
    }

    public void persist() {
        ScoreService ss = new ScoreService();
        ss.insert(this);
        score1 = 0;
        score2 = 0;
        date = Calendar.getInstance(new Locale(new Local().getLocale()));
    }

     // getters and setters for every field

}</pre>
<p><strong>IMPORTANT</strong> Suprascrierea metodelor equals si getHash este obligatorie, pt ca JSF compara obiectele atunci cand lucreaza cu ele.</p>
<p>Clasa Team.java arata cam asa:</p>
<pre>package jsfp;

import java.io.Serializable;
import jdba.TeamService;

public class Team implements Serializable {

    private Long id;
    private String name;
    private String manager;
    private String coach;
    private String mood;
    private Integer points;

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Team)) {
            return false;
        } else {
            Team t = (Team) o;
            if (id != t.getId()) {
                return false;
            } else {
                return true;
            }
        }
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 71 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 71 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 71 * hash + (this.manager != null ? this.manager.hashCode() : 0);
        hash = 71 * hash + (this.coach != null ? this.coach.hashCode() : 0);
        hash = 71 * hash + (this.mood != null ? this.mood.hashCode() : 0);
        hash = 71 * hash + (this.points != null ? this.points.hashCode() : 0);
        return hash;
    }

    public void persist() {
        TeamService ts = new TeamService();
        ts.insert(this);
    }

   // getters and setters for every field

}</pre>
<p>Clasa <strong>Locale</strong> nu are echivalent in baza de date, este folosita doar pentru a stoca variabila de interbationalizare. Ea arata asa:</p>
<pre>package jsfp;

public class Local {

    private static String locale = new String("en");

    public String setLocaleRo() {
        locale = new String("ro");
        return "ro";
    }

    public String setLocaleEn() {
        locale = new String("en");
        return "en";
    }

    public String getLocale() {
        return locale;
    }

    public void setLocale(String locale) {
        this.locale = locale;
    }
}</pre>
<p><strong>Conectarea la baza de date</strong> am realizat-o destul de simplu si ineficient d.p.d.v al scalabilitatii, dar avand in vedere ca asta e doar o tema si nu sunt mai mult de 2-3 utilizatori se accepta <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> . Ideea este urmatoarea: am facut o clasa singleton <em>DbCon</em> care tine o conexiune la baza de date, cand am nevoie de o conexiune de oriunde din aplicatie, apelez aceasta clasa si iau o conexiune. Aceasta clasa arata asa:</p>
<pre>package jdba;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.ResourceBundle;

public class DbCon {

    private static DbCon instance = null;

    private DbCon() {
    }

    public static DbCon getInstance() {
        if (instance == null) {
            instance = new DbCon();
        }
        return instance;
    }

    public Connection getCon() {
        try {
            ResourceBundle rsb = ResourceBundle.getBundle("jdba.DatabaseProps");
            Class.forName(rsb.getString("driver"));
            Connection c = DriverManager.getConnection(rsb.getString("url"), rsb.getString("user"),
                    rsb.getString("pass"));
            return c;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
}</pre>
<p>Pentru a usura optinerea conexiunii am facut o clasa abstracta in care am declarat conexiunea un statement si un String &#8216;query&#8217;, aceasta clasa mai contine si 2 metode de deschidere si inchidere a conexiunii. Aceasta clasa arata asa:</p>
<pre>package jdba;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public abstract class Service {

    Connection c;
    Statement s;
    String q;

    protected void open() {
        try {
            DbCon d = DbCon.getInstance();
            c = d.getCon();
            s = c.createStatement();
            c.setAutoCommit(false);
        } catch (SQLException ex) {
            System.out.println("Error on opening connection");
            ex.printStackTrace();
        }
    }

    protected void close() {
        try {
            c.commit();
            s.close();
            c.close();
        } catch (SQLException ex) {
            System.out.println("Error on closing connection");
            ex.printStackTrace();
        }
    }
}</pre>
<p>Clasa <strong>ScoreService</strong> arata asa:</p>
<pre>package jdba;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;
import jsfp.Score;

public class ScoreService extends Service {

    public void insert(Score sc) {
        open();
        Date now = sc.getDate().getTime();
        q = "insert into score (hoast,guest,score1,score2,date) " +
                "values (" + sc.getHoast().getId() + "," +
                sc.getGuest().getId() + "," +
                sc.getScore1() + "," +
                sc.getScore2() + ",'" +
                now.getDay() + "/" + now.getMonth() + "/" + (1900 + now.getYear()) + "');";
        try {
            s.executeUpdate(q);
        } catch (SQLException ex) {
            ex.printStackTrace();
        }

        if (sc.getScore1() &#62; sc.getScore2()) {
            q = "update team set points = points + " + 3 + " where id = " + sc.getHoast().getId() + " ;";
        } else if (sc.getScore1() &#60; sc.getScore2()) {
            q = "update team set points = points + " + 3 + " where id = " + sc.getGuest().getId() + " ;";
        } else {
            q = "update team set points = points + " + 1 + "where id in (" + sc.getHoast().getId() + "," + sc.getGuest().getId() + ") ;";
        }

        try {
            s.executeUpdate(q);
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        close();
    }

    public Vector getAll() {
        open();
        Vector scores = new Vector();
        q = "select hoast,guest,score1,score2,date from score";
        try {
            TeamService ts = new TeamService();
            ResultSet rs = s.executeQuery(q);
            while (rs.next()) {
                Score sc = new Score();
                sc.setHoast(ts.getById(rs.getLong(1)));
                sc.setGuest(ts.getById(rs.getLong(2)));
                sc.setScore1(rs.getInt(3));
                sc.setScore2(rs.getInt(4));
                String[] dts = rs.getString(5).split("/");
                Calendar cl = Calendar.getInstance();
                cl.set(Integer.parseInt(dts[2]), Integer.parseInt(dts[1]), Integer.parseInt(dts[0]));
                sc.setDate(cl);
                scores.add(sc);
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        close();
        return scores;
    }

    public boolean gameDisputed(long hoast, long guest) {
        boolean flag = false;
        open();
        System.out.println("Hoast = " + hoast + "  Guest = " + guest);
        q = "select * from score where hoast = " + hoast + " and guest = " + guest + ";";
        try {
            ResultSet rs = s.executeQuery(q);
            flag = rs.next();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        close();
        return flag;
    }
}</pre>
<p>Clasa <strong>TeamService</strong> arata asa:</p>
<pre>package jdba;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import jsfp.Team;

public class TeamService extends Service {

    public void insert(Team t) {
        open();
        q = "insert into team (name,manager,coach,mood,points) " +
                "values ( '" + t.getName() + "'," +
                "'" + t.getManager() + "'," +
                "'" + t.getCoach() + "'," +
                "'" + t.getMood() + "',0);";
        try {
            s.executeUpdate(q);
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        close();
    }

    public Team getByName(String nm) {
        open();
        Team t = null;
        q = "select id,name,manager,coach,mood,points from team where name = '" + nm + "' ;";
        try {
            ResultSet rs = s.executeQuery(q);
            while (rs.next()) {
                t = new Team();
                t.setId(rs.getLong(1));
                t.setName(rs.getString(2));
                t.setManager(rs.getString(3));
                t.setCoach(rs.getString(4));
                t.setMood(rs.getString(5));
                t.setPoints(rs.getInt(6));
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        close();
        return t;
    }

    public Team getById(Long nm) {
        open();
        Team t = null;
        q = "select id,name,manager,coach,mood,points from team where id = " + nm + " ;";
        try {
            ResultSet rs = s.executeQuery(q);
            while (rs.next()) {
                t = new Team();
                t.setId(rs.getLong(1));
                t.setName(rs.getString(2));
                t.setManager(rs.getString(3));
                t.setCoach(rs.getString(4));
                t.setMood(rs.getString(5));
                t.setPoints(rs.getInt(6));
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        close();
        return t;
    }

    public Vector getAll() {
        open();
        Vector teams = new Vector();
        q = "select id,name, manager,coach,mood,points from team";
        try {
            ResultSet rs = s.executeQuery(q);
            while (rs.next()) {
                Team t = new Team();
                t.setId(rs.getLong(1));
                t.setName(rs.getString(2));
                t.setManager(rs.getString(3));
                t.setCoach(rs.getString(4));
                t.setMood(rs.getString(5));
                t.setPoints(rs.getInt(6));
                teams.add(t);
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        close();
        return teams;
    }
}</pre>
<p>Fisierul de proprietati &#8216;DatabaseProps&#8217; contine informatiile necesare pt conexiune la baza de date:<br />
user=user<br />
pass=user<br />
url=jdbc:postgresql://localhost:5432/game<br />
driver=org.postgresql.Driver</p>
<p>Clasa <strong>TeamValidator</strong> arata asa:<br />
Eu am facut o validare pentru echipe, si am gandit asa: cand este selectata prima echipa se apeleaza acet validator si este setat id-ul acestei echipe, cand se seteaza a doua echipa se apeleaza din nou acest validator si se seteaza id-ul al doilea, apoi se verifica daca aceste id-uri sunt diferite, asta avertizeaza asupra faptului ca o echipa nu poate juca cu ea insesi.</p>
<pre>package gui.validators;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import jdba.ScoreService;
import jsfp.Team;

public class TeamValidator implements Validator {

    static long t1 = -1;
    static long t2 = -1;

    public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
        Team s = (Team) value;
        if (t1 == -1) {
            t1 = s.getId();
        } else {
            t2 = s.getId();

            ScoreService ss = new ScoreService();
            if (ss.gameDisputed(t1, t2)) {
                t1 = t2 = -1;
                FacesMessage message = new FacesMessage();
                message.setDetail("Game already disputed");
                message.setSummary("Game already disputed");
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                throw new ValidatorException(message);
            }

            if (t1 == t2) {
                t1 = t2 = -1;
                FacesMessage message = new FacesMessage();
                message.setDetail("Teams must not be equal");
                message.setSummary("Teams must not be equal");
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                throw new ValidatorException(message);
            }
            t1 = t2 = -1;
        }
    }
}</pre>
<p>Clasa <strong>TeamGetAll</strong> arata asa:</p>
<pre>package gui;

import java.util.Vector;
import javax.faces.model.SelectItem;
import jdba.TeamService;
import jsfp.Team;

public class TeamGetAll {

    public Vector
 getAll(){
        Vector
 sis = new Vector
();
        TeamService ts = new TeamService();
        Vector vt = ts.getAll();
        for(Team t:vt){
            SelectItem si = new SelectItem(t,t.getName());
            sis.add(si);
        }
        return sis;
    }

    public Vector getTeams(){
        TeamService ts = new TeamService();
        return ts.getAll();
    }
}</pre>
<p>Clasa <strong>ScoresGetAll</strong> arata asa:</p>
<pre>package gui;

import java.util.Vector;
import jdba.ScoreService;
import jsfp.Score;

public class ScoresGetAll {

    public Vector getScores() {
        ScoreService ts = new ScoreService();
        return ts.getAll();
    }
}</pre>
<p>Daca inca mai <strong>citesti</strong> inseamna ca ai vointa <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Acum o sa pun si niste poze cu bucatelele importante din paginile jsp:<br />
pagina de <strong>index</strong> arata asa:<br />
<a href="http://jeemaster.wordpress.com/files/2009/11/index.png"><img class="alignleft size-full wp-image-30" title="index" src="http://jeemaster.wordpress.com/files/2009/11/index.png" alt="" width="1007" height="470" /></a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Pagina <strong>View</strong> arata asa:<br />
<a href="http://jeemaster.wordpress.com/files/2009/11/index1.png"><img class="alignleft size-full wp-image-32" title="index" src="http://jeemaster.wordpress.com/files/2009/11/index1.png" alt="" width="798" height="702" /></a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Pagina <strong>Teams</strong> arata asa:</p>
<p><a href="http://jeemaster.wordpress.com/files/2009/11/index2.png"><img class="alignleft size-full wp-image-33" title="index" src="http://jeemaster.wordpress.com/files/2009/11/index2.png" alt="" width="781" height="907" /></a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Pagina <strong>Edit</strong> arata asa:</p>
<p><a href="http://jeemaster.wordpress.com/files/2009/11/index3.png"><img class="alignleft size-full wp-image-34" title="index" src="http://jeemaster.wordpress.com/files/2009/11/index3.png" alt="" width="961" height="1177" /></a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Cam asta e tot&#8230;<br />
cireasa de pe tort: asta e o aplicatie mica :d analiza placuta si cititi cu atentie tutorialele de la linkurile  pe care le-am pus la inceputul paginii.<br />
PS: asta e si faces config:<br />
<a href="http://jeemaster.wordpress.com/files/2009/11/index4.png"><img class="alignleft size-full wp-image-40" title="index" src="http://jeemaster.wordpress.com/files/2009/11/index4.png" alt="" width="684" height="2498" /></a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Spor in continuare.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Java EE Got it Wrong]]></title>
<link>http://zerocredibility.wordpress.com/2009/11/17/java-ee-got-it-wrong/</link>
<pubDate>Tue, 17 Nov 2009 18:08:14 +0000</pubDate>
<dc:creator>Jeffrey Blattman</dc:creator>
<guid>http://zerocredibility.wordpress.com/2009/11/17/java-ee-got-it-wrong/</guid>
<description><![CDATA[After working on two large-scale, cross contains / platform, web application projects, I&#8217;ve co]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>After working on two large-scale, cross contains / platform, web application projects, I&#8217;ve come to the conclusion that Java EE is fatally flawed.</p>
<p>If someone asked you to state the most important, guiding principle of the Java language, what would you say? You would would probably say &#8220;write once, run anywhere.&#8221; Indeed, for Java SE this holds true most all of the time. In Java EE however, it is hopelessly broken. The reality is that every web container is slightly different in ways that force developers work around problems, avoid certain features, or even have different code paths. Different code paths in a language that was never designed for it.</p>
<p>Different aspects of Java EE have different levels of stability. JSP works almost the same across all containers. Things like JSF and Java Persistence (JPA) however are hopeless. My most recent experience is writing a web administration console using JSF for the <a href="https://opensso.dev.java.net/">OpenSSO</a> project. OpenSSO claims to support at at least 8 different web containers. Every container required JSF tweaking that ranged from annoying to just plain terrible. Needless to say I had egg on my face to some degree over the choice to use JSF. It was a no-brainer for me. JSF is the chosen MVC framework for Java EE. My mistake.</p>
<p>The only container where JSF &#8220;just worked&#8221; was Tomcat. Tomcat isn&#8217;t a Java EE container at all.Tomcat doesn&#8217;t include JSF or any of it&#8217;s dependencies. We might be on to something here. Let&#8217;s look at another example: Spring. Spring is essentially a lighter-weight, simpler replacement for Java EE. Why is Spring so popular? One reason is that it is an elegant design. But another, perhaps more important reasons is that no matter what container you are developing on, Spring is Spring. It&#8217;s the same JAR, the same code, the same implementation. It makes very few assumptions about the capabilities of the underlying container. Another example is Facelets, a light-weight JSP replacment. I use JSF+Facelets on the OpenSSO project, and it has been flawless (the Facelets part). Why? Because I include the Facelets JAR, it is not provided by the system.</p>
<p>What if Java EE had followed the same model? Java EE should have been nothing more than a plugin framework and some base services. Want to use JSF in your project? Just include it from a managed, networked Java EE module repository. Include the one, common implementation of JSF. Include the approved version for your level of Java EE. If you support Java EE 5, you get JSF version X, across all web containers.</p>
<p>&#160;</p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[JSF] URL não é atualizada no Browser]]></title>
<link>http://ldiasrs.wordpress.com/2009/11/17/jsf-url-nao-e-atualizada-no-browser/</link>
<pubDate>Tue, 17 Nov 2009 12:01:35 +0000</pubDate>
<dc:creator>ldiasrs</dc:creator>
<guid>http://ldiasrs.wordpress.com/2009/11/17/jsf-url-nao-e-atualizada-no-browser/</guid>
<description><![CDATA[Depois de iniciar minha aplicação JSF e começar a desenvolver algumas paginas JSP, percebi que a med]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h3><span style="font-weight:normal;">Depois de iniciar minha aplicação JSF e começar a desenvolver algumas paginas JSP, percebi que a media que ia entrado nos links de menu para navegar entre as paginas, a  URL do browser não era atualizada com a pagina corrente, mas sim com a pagina anterior. Depois de pesquisar um pouco descobri uma solução,  segue o resumo da opera:</span></h3>
<h3>Problema</h3>
<p>Quando é acessado os links/menus do JSF a URL do browser não é atualizada com o endereço da pagina corrente.</p>
<h3>Solução:</h3>
<p>Colocar nas regras de navegação no arquivo <em>faces-config.xml</em> a tag<em> </em></p>
<p><em> </em></p>
<pre>&#60;redirect/&#62;</pre>
<p><strong>Exemplo</strong></p>
<p>&#160;</p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"> &#60;navigation-rule&#62;</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"> &#60;display-name&#62;downloadChangelog&#60; /display-name&#62;</span></p>
<pre>  &#60;from-view-id&#62;/uncommitedChangeRequestView.jsp&#60; /from-view-id&#62;
  &#60;navigation-case&#62;
   &#60;from-outcome &#62;gotoDownloadChangelogFile&#60;/from-outcome&#62;
   &#60;to-view-id &#62;/downloadChangelogFile.jsp&#60;/to-view-id&#62;
<strong>   &#60;redirect/&#62;</strong>
  &#60;/navigation-case&#62;
 &#60;/navigation-rule&#62;</pre>
<p>&#160;</p>
<p><strong>Problemas da solução</strong><br />
Os seus backbeans com scopo de request perderão os atributos, então antes de aplicar a tag em uma pagina qualquer, certifique-se que não esta usando um bean com scopo de request.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[View scope in Spring]]></title>
<link>http://yigitdarcin.wordpress.com/2009/11/17/view-scope-in-spring/</link>
<pubDate>Mon, 16 Nov 2009 22:33:38 +0000</pubDate>
<dc:creator>yigitdarcin</dc:creator>
<guid>http://yigitdarcin.wordpress.com/2009/11/17/view-scope-in-spring/</guid>
<description><![CDATA[If you want to have View Scope in Spring for JSF, firstly read here and here. The problem with above]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If you want to have View Scope in Spring for JSF, firstly read <a href="http://www.jroller.com/RickHigh/entry/adding_a_jsf_view_scope">here</a> and <a href="http://www.jroller.com/RickHigh/entry/added_new_view_scope_to">here</a>.</p>
<p>The problem with above was, those needed our @Scope(&#8220;view&#8221;) beans to be serialized.</p>
<p>We didn&#8217;t want to serialize our beans so we did the following workaround:</p>
<p>we defined our Autowired DAO classes as :</p>
<p>@Autowired<br />
private <strong>transient</strong> DAO myDao;</p>
<p>and based on Rick&#8217;s above ViewScope implementation we added those 2 lines of code:</p>
<p><code>public class ViewScope implements Scope, <strong>ApplicationContextAware</strong></code></p>
<p>&#8230;.</p>
<p><code>	@Override<br />
	public void setApplicationContext(ApplicationContext applicationContext)<br />
			throws BeansException {<br />
		this.applicationContext = applicationContext;<br />
	}</code></p>
<p>&#8230;<br />
and finally in get method, after getting the object we did<br />
<code><br />
applicationContext.getAutowireCapableBeanFactory().autowireBean(objToReturn);</code></p>
<p>to autowire the dependencies again.</p>
<p>hope it helps for you also&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[IceFaces 2.0 Alpha]]></title>
<link>http://stephanodesign.wordpress.com/2009/11/16/icefaces-2-0-alpha/</link>
<pubDate>Mon, 16 Nov 2009 21:28:34 +0000</pubDate>
<dc:creator>Stefan</dc:creator>
<guid>http://stephanodesign.wordpress.com/2009/11/16/icefaces-2-0-alpha/</guid>
<description><![CDATA[I&#8217;m very pleased to announce that ICEfaces 2.0 &#8211; Alpha 1 is now available for download. ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;m very pleased to announce that ICEfaces 2.0 &#8211; Alpha 1 is now available for <a href="http://www.icefaces.org/main/downloads/os-downloads.iface">download</a>.</p>
<p>This inaugural development milestone release of ICEfaces 2.0 provides the fundamental capability of running the next-generation ICEfaces core on the Mojarra JSF 2.0.1 runtime. You can plug the icefaces.jar into your existing JSF2 application and immediately receive some of the benefits of ICEfaces Direct-to-Dom rendering, such as providing incremental page updates without the need to specify the JSF 2 &#8220;f:ajax&#8221; tag. A sample application is included demonstrating ICEfaces 2 with JSF 2 (&#8220;h:&#8221;) standard components, and Ajax Push.</p>
<p>Also included in this release is the initial implementation of the ICEfaces 1.x compatibility libraries, along with sample applications that demonstrate this capability. The ICEfaces 1.x compatibility libraries are used to readily port your existing JSF 1.2 / ICEfaces 1.8 applications to JSF 2.0 / ICEfaces 2.</p>
<p>See the <a href="http://www.icefaces.org/releasenotes/ICEfaces-2.0.0-Alpha1-RN.html">Release Notes</a> for all the details.</p>
<p>We are planning to have another significant ICEfaces 2 milestone release, featuring the beginnings of our all-new ICEfaces 2 component suite, before the end of this year, so stay tuned!</p>
<p>Source: <a href="http://www.icefaces.org">www.icefaces.org</a> <a href="www.icefaces.org"><img class="alignnone size-full wp-image-8" title="icefaces" src="http://stephanodesign.wordpress.com/files/2009/11/icefaces1.jpg" alt="" width="96" height="79" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[IceFaces 1.8.2]]></title>
<link>http://stephanodesign.wordpress.com/2009/11/16/icefaces-1-8-2/</link>
<pubDate>Mon, 16 Nov 2009 21:25:23 +0000</pubDate>
<dc:creator>Stefan</dc:creator>
<guid>http://stephanodesign.wordpress.com/2009/11/16/icefaces-1-8-2/</guid>
<description><![CDATA[ICEfaces 1.8.2 is now available for download, SVN repository checkout, or via Maven public repositor]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>ICEfaces 1.8.2 is now available for <a href="http://downloads.icefaces.org/" target="_new">download</a>, <a href="http://www.icefaces.org/main/community/svninfo.iface" target="_new">SVN repository</a> checkout, or via <a href="http://www.icefaces.org/JForum/posts/list/14793.page" target="_new">Maven public repository</a>.</p>
<p>ICEfaces 1.8.2 is an official maintenance release that includes 165 fixes and improvements. Notable changes include:</p>
<li>All-new support for &#8220;cookieless&#8221; mode operation for synchronous ICEfaces applications (deployed to browsers with cookies disabled).</li>
<li>Enhanced keyboard navigation for the menuBar, menuPopup, panelCollapsible, panelTabSet, and tree components.</li>
<li>The panelTab component now supports an optional label facet for defining arbitrarily complex labels.</li>
<li>Enhanced dataExporter: define which columns &#38; rows to export, seamless operation with dataPaginator, portlet support, and improved robustness.</li>
<li>Improved panelTooltip: smarter positioning, mouse tracking, and customizable display event triggers (hover, click, etc.).</li>
<li>Support for nested modal panelPopups.</li>
<li>The inputFile component now supports optional &#8220;autoUpload&#8221; mode.</li>
<li>The graphicImage component now supports all ICEfaces Resource APIs for specifying image resources.</li>
<li>The outputResource component now has improved special character support for resource file-names.</li>
<li>Rendering performance optimizations have been made to the dataTable, panelGroup, panelSeries, and menuBar components.</li>
<li>Updated Component Showcase sample application illustrating new component capabilities.Please read the <a href="http://www.icefaces.org/releasenotes/icefaces-1.8.2-RN.html" target="_new">Release Notes</a> (also included in the release bundle) for details on new features, known issues, and other notes.</li>
<p>Source: <a href="http://www.icefaces.org">www.icefaces.org</a><a href="www.icefaces.org"><img class="alignnone size-full wp-image-5" title="icefaces" src="http://stephanodesign.wordpress.com/files/2009/11/icefaces.jpg" alt="" width="96" height="79" /></a></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
