Total Pageviews

2010/06/28

Apache Maven Configuration

1. Download: http://maven.apache.org/download.html

2. set M2_HOME=D:\lib\apache-maven-2.2.1-bin

3. Add the bin directory to your PATH, eg: %M2_HOME%\bin

4. Make sure JAVA_HOME is set

5. Run mvn --version to verify that it is correctly installed.


2010/06/21

Java Server Faces + Spring MVC Framework

Check out this SlideShare Presentation:

2010/06/19

javax.faces.FacesException: javax.servlet.ServletException: java.lang.IllegalStateException: Component javax.faces.component.UIViewRoot@14ad592 not ex

Problem
javax.faces.FacesException: javax.servlet.ServletException: java.lang.IllegalStateException: Component javax.faces.component.UIViewRoot@14ad592 not expected type. Expected: javax.faces.component.UIForm. Perhaps you're missing a tag?

Solution:
insert f:view tag into JSP page

2010/06/16

Java Code Completion does not work in MyEclipse


Environment:
  1. Mac OS
  2. Myeclipse 7.1

Problem: Code Completion Does not Work

Solution:
Go to Preferences>Java>Editor>Content Assist>Advanced> Checked Other Java Proposals

2010/06/10

Spring bean mod02

Check out this SlideShare Presentation:

Spring mvc

Check out this SlideShare Presentation:

Spring db-access mod03

Check out this SlideShare Presentation:

Toms introtospring mvc

Check out this SlideShare Presentation:

2010/05/30

Taipei 101 Run Up



2010/05/06

2010/04/28

Observer Pattern


Strategy Pattern

Check out this SlideShare Presentation:

2010/04/06

2010/03/17

2010/03/03

Java Enterprise Development - 2010 style


  • You use the Java EE 6 Web Profile, and don´t need to pack your application into an EAR file.
  • You code your domain model using a xml-less ORM fram framework (JPA). JPA actually makes sense and does what its supposed todo without fuss.
  • You let your JPA implementation generate your database schema for you, which it does with surprising efficiency.
  • You use modern, component-based view frameworks (like Facelets or Wicket) , and get by writing little or no XML for defining navigation (remember struts-config.xml?)
  • You use annotations everywhere (your JPA entities, your Session Beans, your Servlets) and even start to forget XML syntax
  • You don´t bother writing deployment descriptors for all your session beans. You just add one annotation to any POJO and it automatically gains EJB powers.
  • You only write Remote Interfaces when you actually needs a component to be remotely accessible.
  • You have no idea what CORBA is.
  • You have a vague idea of what JNDI is, but you use dependency injection everywhere to get what you need.
  • You develop using a lightweight application server (glassfish 3) that redeploys your application in seconds every time you make a change. Most of the time you don't even notice it.

2010/02/19

Apply AutoComplete component in Flex



Go to here to download AutoComplete Component: http://hillelcoren.com/flex-autocomplete/


After you download its zip file, extract it and you can find out AdvancedAutoComplete-1.0.swc in bin directory.

Add SWC file into Flex Build Path


Create a value object, which called "People".
This value object contains three attributes, including name, gender and mail.

package vo
{
public class People
{
public function People(iName:String, iGender:String, iMail:String)
{
name = iName;
gender = iGender;
mail = iMail;
}
public var name:String;
public var gender:String;
public var mail:String;

}
}

Create a new MXML Application file, which called "AutocompleteTest".
Click "Finish"


Add a new namespace for this AutoComplete Component

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:components="com.hillelcoren.components.*"
layout="absolute" >
</mx:Application>


Declare an ArrayCollection variable for AutoComplete component as its data provider.
And add value object, People, into this ArrayCollection as page load.
Use AutoComplete tag to realize auto complete function.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:components="com.hillelcoren.components.*"
layout="absolute" initialize="init()">
<mx:Script>
<![CDATA[
import vo.People;
import mx.collections.ArrayCollection;

//declare an ArrayCollection as AutoComplete component's data provider
[Bindable]
private var peopleList:ArrayCollection = new ArrayCollection();

//set data into people list as page load
private function init():void{
peopleList.addItem(new People("Albert", "Male", "albert@gmail.com"));
peopleList.addItem(new People("Mandy", "Female", "mandy@gmail.com"));
peopleList.addItem(new People("Verio", "Male", "verio@gmail.com"));
peopleList.addItem(new People("Richard", "Male", "richard@gmail.com"));
peopleList.addItem(new People("Andrew", "Male", "andrew@gmail.com"));
}
]]>
</mx:Script>
<mx:HBox>
<mx:Label text="Name" />
<components:AutoComplete id="autoComplete" labelField="name" dataProvider="{peopleList}" />
</mx:HBox>
</mx:Application>


Demo

As I type in "A", it will show some options for me to select.

As I select "Albert", then it will show my selection in the text field.





2010/02/05

Building The SpringGraph Flex Component

Check out this SlideShare Presentation:

2010/02/02

Integrate Flex With Spring Framework

Check out this SlideShare Presentation:

2010/02/01

Access Net Web Services From Java

Check out this SlideShare Presentation: