Search This Blog

Saturday, December 25, 2010

Most Favorite Actress & Actor 2010

Most Favorite Actress & Actor 2010. Who is the most favorite actor and actress in 2010? well here's the news about it. At the end of 2010, the handsome actor Leonardo DiCaprio was became the best-selling actor for 2010. In the list compiled by Forbes magazine, Leonardo DiCaprio who is 36-year-old managed to pocket the profits of sales of 1.1 billion U.S. dollars worldwide. The amount of money

Thursday, December 23, 2010

Ryan Eryandez Penyebar Pertama Video Ariel

Ryan Eryandez Penyebar Pertama Video Ariel, Ryan eryandez? siapa lagi nih? setelah nama anggit gagah pratama naik menjadi salah satu orang yang paling bertanggung jawab atas beredarnya Hot video ariel dan luna maya kini ada nama baru lagi mencuat. dia adalah Ryan Eryandez. siapa dia? dan apa hubungannya dengan anggit gagah pratama?

Bantahan Anggit menyebarkan video porno Ariel, memunculkan nama

Thursday, December 16, 2010

Koleksi SMS natal 2010

Koleksi SMS natal 2010, Natal akan segera tiba, sudahkah anda mempersiapkan segala sesuatunya seperti dekorasi pohon natal anda atau membuat kue kue natal yang lezat? biasanya orang mulai mengumpulkan koleksi SMS natal untuk dikirim ke kerabat maupun teman mereka sebagai ucapan selamat natal, berikut adalah beberapa koleksi SMS natal 2010 terbaik yang bisa anda kirimkan kepada sanak famili.

We

Tuesday, December 14, 2010

JSF 2 with Spring 3 - basics (part 1 of 2)

Requirements:
  • a working example from the last article of a serie introducing new JSF 2.0 features.
You will learn:
  • how to integrate Spring Framework into JSF 2.0 application
In the previous three posts I described some interesting JSF 2.0 features and I put them together in the sample application. Those parts were mostly focused on web content, a GUI and its behaviour.
What about the server side? What about the business logic executed underneath? Do we had a business logic in the sample application mentioned above? Of course we had. Presenting bikes list or a certain bike under some condition -  this is business logic resposniblity. Filtering bikes and presenting only those with the discount - this is also business logic. Don't think of it as a naive filtering of presented data - the business logic decides what does it mean that the certain bike has discount - it can be lower price but it can be also more complicated. In the previous example we had a class named BikeDataProvider.java which represented business logic. It was a singleton invoked with the help of static method getInstance() anywhere where needed.
When the application starts to grow up, we have more business logic accomplishing some business cases. We need something that will help us to manage the whole business logic in an elegant way - this is where Spring comes to play.
We will change the BikeDataProvider class into object created and managed by Spring. This object will be called service. A service which serves business logic. Then the service will be used by JSF managed beans. Let's add Spring to our sample web apllication. 

Step 1: adding required Spring libraries into the project.


Step 2: creating Spring's configuration file named applicationContext.xml. The file has to be located inside /WEB-INF directory. This is full content of that file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:faces="http://www.springframework.org/schema/faces"
xmlns:int-security="http://www.springframework.org/schema/integration/security"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/integration/security http://www.springframework.org/schema/integration/security/spring-integration-security-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<context:component-scan base-package="com.jsfsample" />

</beans>

Step 3: modifying web.xml by registering listener resposnible for loading Spring in web application.
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
Step 4: modifying faces-config.xml file for allow JSF components use Spring components.
<application>
... <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
...
</application>
Step 5: modifying BikeDataProvider.java toward Spring managed service.

First of all we will add a new functionality to the application - possibility to add a new bike to the selected category. We need to create an .xhtml page with the form, then managed bean for that page and at the end a business logic method in class BikeDataProvider.java responsible for adding new bike to bikes' list. That's easy part - it will be visible in the attached complete example. 
Assuming that we have this new funcitonality, we can modify .java files for Spring integration. First we create an interface: 
package com.jsfsample.services;
//imports
public interface BikeDataProvider {

public List<Bike> getBikesByCategory(Integer categoryId,
boolean onlyWithDiscount);

public Bike getBikeById(Integer id);

public void add(Bike newBike); // new function

Then we have to create an implementation named BikeDataProviderImpl.java (yes, I know that this naming convention is bad) which will have the source code from previous BikeDataProvider.java class. This implementation will have Spring specific annotation defining the service:
package com.jsfsample.services.impl;
//imports
@Service("bikeDataProvider")
public class BikeDataProviderImpl implements BikeDataProvider {

private List<Bike> bikes;
private Integer currentBikeId;

@PostConstruct
private void prepareData(){
bikes = new ArrayList<Bike>();

// MTB
Bike mtb1 = new Bike();
mtb1.setId(1);
mtb1.setName("Kellys Mobster");
mtb1.setDescription("Kellys Mobster, lorem ipsut...");
mtb1.setPrice(6500);
mtb1.setCategory(1);
bikes.add(mtb1);
// other bikes are mocked up the same way

}

public List<Bike> getBikesByCategory(Integer categoryId, boolean onlyWithDiscount) {
// implementation
}
public Bike getBikeById(Integer id){
// implementation
}

public void add(Bike newBike) {
bikes.add(newBike);
}
The annotation @Service("bikeDataProvider") means that this is Spring managed object (created by Spring) and is visible in the Spring context under the name "bikeDataProvider". @PostConstruct is a little trick here - when object of this class is instantiated by Spring, the method is invoked right after the object is created. I used this for preparing demo data of bikes. The whole BikeDataProviderImpl.java class acts as a simple data source for the application - in the future we will use a real database instead.

Step 6: modifying JSF managed beans to use Spring service inside.

We will use registered Spring service inside JSF managed-beans. For example consider BikeDetails.java managed bean. Previously we loaded certain bike in this way:
package com.jsfsample.managedbeans;
// imports
@ManagedBean(name="bikeDetails")
@RequestScoped
public class BikeDetails {

private Integer bikeId;
private Bike bike;

public void loadBike(){
bike = BikeDataProvider.getInstance().getBikeById(bikeId);
}
...
}
Now BikeDataProvider.java is not a singleton - it is a Spring service. BikeDetails.java managed bean is changed:
package com.jsfsample.managedbeans;
// imports
@ManagedBean(name="bikeDetails")
@RequestScoped
public class BikeDetails {

private Integer bikeId;
private Bike bike;

@ManagedProperty("#{bikeDataProvider}")
private BikeDataProvider bikeDataProvider; // injected Spring service

public void loadBike(){
bike = bikeDataProvider.getBikeById(bikeId);
}
...
}
We used the name of registered service ("bikeDataProvider") to inject it into JSF managed bean (please note that we used here an interface as an instance variable, Spring injects its concrete implementation). This injection is possible thanks to modifications from step 4.


That's all. Other JSF managed beans responsible for displaying bikes' lists or adding a bike use mentioned Spring service in the same way.

-------------------------------------------
Download source files:
The complete working example of mentioned application which will contain all described issues, will be available in the last (second) article of this serie.


Sexy Hot Pictures of Anna Faris

Anna Farris first became famous with her "Scary Movie" movies, that were a joke about a lot of scary movies that are out. Their jokes in those movies are classic. Thanks to Anna, and her funny faces it really made that movie stand out. I consider these her break-through movies, and I loved every single one of them. Another movie she came out in was "The House Bunny" this was a hilarious movie about a fraternity, and she comes from the Playboy mansion. Here are some hot pictures I found of Anna Farris on the Internet...







Wednesday, December 8, 2010

Wedding Photo of Marcella Zalianty and Ananda Mikola

Wedding Photo of Marcella Zalianty and Ananda Mikola, as mentioned before on our post about Ananda mikola and marcella zalianty wedding now we're gonna give you a report on their wedding ceremony and several of their wedding photo.


Celebrity couples Ananda Mikola and Marcella Zalianty using the concept of the modern colonial Java in reception as well. Ananda-Marcella wedding reception was held

Friday, December 3, 2010

Gosip Revaldo Meninggal di Penjara

Gosip Revaldo Meninggal dunia di penjara, revaldo yang ditahan akibat kasus penggunaan narkoba digsipkan meninggal dunia. namun kabar meninggalnya revaldo mantan bintang sinetron ada apa dengan cinta TV series ini hanya lah hoax semata. Beredar kabar lewat BBM dan Twitter, aktor Revaldo meninggal dunia karena overdosis narkoba di penjara. "Inalilahi wainalilahi rojiun...artis muda Revaldo

Ayu Azhari Dilaporkan Anaknya Terkait Kasus Warisan

Ayu Azhari Dilaporkan Anaknya Terkait Kasus Warisan - Axel putra tertua ayu azhari berencana untuk melaporkan ibunya atas kasus hak waris, Aktris Ayu Azhari yang kembali ribut dengan anak sulungnya, Axel terancam dilaporkan ke polisi. Axel (20 tahun) akan melaporkan sang ibu jika tidak kunjung mendapatkan warisan Rp 150 juta yang didapatnya dari alamrhum ayahnya. Sungguh ironis jika akhirnya axel

Foto Mulan Jameela Berjilbab Lebar

Foto Mulan Jameela Berjilbab Lebar - Beredar foto mulan jameela menggunakan jilbab lebar, sejak mulan digosipkan hamil sepertinya mantan rekan duet maia estianty di ratu ini sulit di hubungi dan ditemui. Setelah bos Republik Cinta Management (RCM) Ahmad Dhani mengaku menyembunyikan Mulan demi strategi pasar sebelum peluncuran album, tiba-tiba foto si Wonder Woman berjilbab beredar di internet.

Thursday, December 2, 2010

Lea Michele Plays the Hot Virgin Girl from Glee

She is hot in her own innocent way. She likes to tease Fin, the football player and she is very off and on. Recently in the show she has admitted to Fin that she is a virgin. However of course this is not real life. She has done plenty of sexy photo shoots, including a controversial photo shoot for GQ magazine. Do parents approve? Probably not...Do I approve? Hell yes I do...Here are some hot and sexy photos of Lea Michele...





Meet the Councilor from Glee. Everyone has a crush on her.

Jayma Mays plays the councilor on the television show Glee. She is very pretty and she walks with a limp cause shes a pimp. She has the Glee teacher head over heals in love with her, and for good reason. She plays hard to get and even dated a guy from Full House on the show that plays a dentist. John Stamos I believe his name is, but don't quote me on that. I have found a number of hot pictures of Jayma Mays and i felt like I had to share them with you so here they are...





Dianna Agron is the Blonde Cheerleader from Glee

Dianna Agron was born into a rich family and her father was general manager with Hyatt hotels. She did a lot of traveling as a young girl betwen Savannah and San Francisco. She loves being in the spotlight and she has a lot of talent. She plays a blonde cheerleader in Glee who was once kicked out of the cheerios because she got pregnant. She later rejoined them, but not after being criticized and ridiculed for her sexual decisions. I love the television show Glee, and there are many hot little girls that star in the show, so I will show you some pictures that I have found of Dianna Agron...