Category Archives: Spring

Loggging using log4j API

1. Add the dependencies in the POM.xml file like as follows: 2. Make a log4j.properties file under the root folder of the project having the following data : # Root logger option log4j.rootLogger=DEBUG, stdout, file # Redirect log messages to console log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L – %m%n # Redirect log messages to Continue Reading…

Spring MVC + REST service

Step-1: Add maven plugin to the eclipse to add the library of the spring framework. After that make a new maven project and add the dependencies to the POM.xml file like as follows: 4.0.0 com.mail Mail 0.0.1-SNAPSHOT war Mail http://maven.apache.org UTF-8 org.springframework spring-webmvc 4.0.1.RELEASE org.springframework spring-core 4.0.1.RELEASE org.codehaus.jackson jackson-core-asl 1.9.13 org.codehaus.jackson jackson-mapper-asl 1.9.13 Hew we Continue Reading…