Friday, February 26, 2016

Play with spring integration test

This article is mainly about using spring-test for integration test. Some basic issuses of integration test are discussed for projects with following natures: It's a maven project It's also a Spring webmvc proejct It's developed in Eclipse. This article is based on Spring framework 4.2 + 0. Basics...

Sunday, February 21, 2016

Exception handling in spring mvc/rest application

0. What you need Spring framework 4.x 1. Goal of Exception handling First let's clarify the goal for exception handling in Spring mvc/rest application: Goal 1. Deprive exception handling code from business logic to make code cleaner. The fundamental try-catch mix the business code with exception handling...

Thursday, February 18, 2016

Response for GET/POST/PUT/DELETE in REST web service

Before talking about the details, one thing need to be clarified. HTTP status code is designed far before RESTful web service appears.  So when REST go popular, people just try to use the most reasonable http behaviour in everyone's understanding of REST.  Here in this article I put some summary...

Tuesday, February 16, 2016

How to use H2 embeded database in spring application

H2, as a embeded memory database, is mainly used for development and test phase. H2 also has a web console which is very convenient. 1. Use H2 in Spring boot application Spring boot has almost everything done for you. You need to do 2 steps, first inluce H2 in you pom.xml. <!-- H2 --> <dependency> ...

Monday, February 15, 2016

Generate a random String of specified length in Java

Sure you can write a short piece of code of your own to do this, but apache's common library makes it just a one line task.  Furthurmore, the library is so widely used, it's maybe already in your class path involved by other third party library even you haven't noticed that.  In case you don't have it in your class path, add this to you maven pom.xml<dependency> <groupId>org.apache.commons</groupId> ...

Wednesday, February 3, 2016

Improve content assist for xml in Eclipse

The default configuration for xml content assist doen't feel very convenient for real usage.When you change you maven pom.xml or maybe the spring xml-style config files, the eclipse doesn't give you much help automatically. To get assist you need to keep pressing Ctrl+Space. Here is a simple tip to...

Monday, February 1, 2016

Quick overview of Maven plugin configuration

This article tries to give a quick generic overview of Maven plugins. In the end a pluginin usage is given and explained, so you can get a feeling of how maven plugins look like as a whole.  plugins refer to maven plugins in the following context. 1. Plugin naming rules The naming convention for...

How to let maven copy(scp) created jar/war package to other location

In real development, you may found your development environment is different from the running environment. For example, like my own case,  I'm working on a Hadoop/Spark related project.  So I have all my source code and development environment like Eclipse/Maven setup on my Windows laptop,...
Powered by Blogger.

About The Author

My Photo
Has been a senior software developer, project manager for 10+ years. Dedicate himself to Alcatel-Lucent and China Telecom for delivering software solutions.