Quick Webservices

If you want to expose existing API as web services …try this…


How to test them?



#apache-axis, #enunciate, #web-services

How to build single JSP page based sites in 4 hours?

Problem Statement: How to build quick web report?

Requirement: The report cotains same story lines with different data from database.

With the help of JSTL, JSP and Display Tag completed coding with out single java file or configuration.

Create basic structure to build the code

>mvn archetype:create -DgroupId=com.abcd.xyz -DartifactId=project_war_name -DarchetypeArtifactId=maven-archetype-webapp

Technologies Used:
Display Tag, JSTL, JSP

HTML Editor: http://www.coffeecup.com/free-editor use to build basic three page layout.

Add these dependencies to pom.xml file



<!-- standard.jar -->

Add following code with real data to index.jsp page

<b>Heading of query information</b>
<sql:query var="results_abcd" dataSource="${dataSource}">
select col1, col2,col3 from table1 where condition1='asdf'
<display:table name="pageScope.results_abcd.rows" id="table5" >
 <display:column property="col1" sortable="true" />
 <display:column property="col2" sortable="true" />
 <display:column property="col3" sortable="true" />

more jstl examples: http://academic2.strose.edu/Math_And_Science/avitabij/cis455fall07/jstljdbc/notes.htm
Note: in JSTL we need to use escape charecters when required during copy paste query from SQL editor to JSTL code.
Example: where userid like '%%'
in JSTL: where userid like '%\%'

Java – Performance Monitoring

Problem: One method is taking 30 seconds. How can we bring it down to the minimal?

First we need to identify all the code (methods) executed.
Get the time took by each method. So that we can troubleshoot one at a time.

How to do this?

1. Simple solution: Using difference of start time and end time.
We can’t use this always. This is not production quality code and we can’t litter the code with all these methods and calculations.

2. Using API level code
JMON API http://jamonapi.sourceforge.net/

3. Using Monitors. This is best way to test distributed installations.
InfraRED http://infrared.sourceforge.net

  • – –


Java Reports, Charts, Barcode

Free Open Source Reports to use with Java

Jasper Reports – http://jasperforge.org/projects/jasperreports
JFree Charts – http://www.jfree.org/jfreechart/samples.html
Print Barcode – http://barbecue.sourceforge.net/


#java-barcode, #java-charts, #java-graphs

Web based development

Recently looked at it. And it looks great.

This is easy to build application based on CRUD operations for existing database.

This provides nice tabular view of the data with lots of features. Used in many projects.

SUN JavaOne Conference Content

SUN JavaOne Conference Content



Log4j.xml Configuration through Java

URL url = AbstractTestCase.class.getResource( “/xyz/dev/asdf_log4j.xml” );

PropertyConfigurator.configure( url );

This wont give any error. It wont work. Because it works only with propertes file.


This is correct one to load .xml files.

This is not going to work with SLF4J.