Skip to main content


Showing posts from July, 2011

Write simple codes

Rule #1: codes should simple

Struggling for fixing the bugs within the complex and repeatable codes in the projects. Codes should always be  simple and readable.  If you have to write complicated codes, refer to rule #1.

Lesson learned from current projects(ongoing)

Took a few months to be familiar with existing projects and try to fix bunch of issues reported by customer and team. Learned huge amount of things from the codes,
1. Use hibernate instead of jdbc sql. This will be extremely help to deal with the change of requirements.
2. Nice convention is necessary. The Java Class should have  the same pre-file name with the Jsp page; Should put all those similiar function codes in one place(e.g. pojo in folder Model , dao in Dao, controller in Controller ,service in folder service), put all the constants in one file(it's really helpful when you have to change them)
3. Test is important( need to plan the test before you commit the codes in production)
4. Version control. Currently, the projects running on three places. The development, staging and production.
The production running the stable codes retrieved from trunk, the staging always have the tested codes from development environment; development environment have the latest codes(some of t…

Spring 3.0 ,Axis2 1.6 Integration in Eclipse

You can find this kind of blog from lots of place. The key is:
in file /META-INF/services.xml ,
Should add below bold part to the auto-generated code by Eclipse.

<service name="xxxxWebService" >
Please Type your service description here
<parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier</parameter>
<parameter name="SpringBeanName"> 
<messageReceiver mep="" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver  mep=""  class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
<parameter name="ServiceClass" locked="false">com.xxxxWebService</parameter>

Obtaining Spring Releases From Maven Central

You do not have to add a repository to your .pom to obtain final releases of Spring projects from Maven Central. Simply add the dependencies your project requires. A .pom <dependency> snippet for each Spring Framework 3 artifact as it will be indexed in Maven Central is listed below.

<!-- Shared version number properties -->

    Core utilities used by other modules.
    Define this if you use Spring Utility APIs (org.springframework.core.*/org.springframework.util.*)

    Expression Language (depends on spring-core)
    Define this if you use Spring Expression APIs (org.springframework.expression.*)

How to config Spring JdbcTemplate


spring : applicationContext.xml
<!-- DataSource defintion -->
<bean id="dataSource"
<property name="driverClassName">
<property name="url">
<property name="username">
<property name="password">

<bean id="abcDao" class="co…