19 July 2007

Access environment using ant

You can access environment variables within Ant using:


<property environment="env">


This provides all environment variables as Ant properties prefixed by "env.". For example, CLASSPATH would be accessible in Ant as ${env.CLASSPATH}.

Tomcat 5 Application Server Module Ant Code

http://www.blogger.com/post-create.g?blogID=2703864537782412832

18 July 2007

ANT Heap Memory

Well a bit of Googling turned up that Ant looks for an environment variable called ANT_OPTS which is use to set Java parameters. Just set the environment variable and off you go. So I added the following to increase the heap size:

export ANT_OPTS=-Xmx256m

That sets the maximum heap size to 256 Megabytes. It solved my problem as the XSLT transform topped out at about 220Meg. So if you ever need to increase the size of the Ant JVM, now you know how.

07 July 2007

Java Report - Open Source & Free

Popular Java Report Generating Tool

JasperReports is a powerful open source Java reporting tool that has the ability to deliver rich content onto the screen, to the printer or into PDF, HTML, XLS, CSV and XML files.

It is entirely written in Java and can be used in a variety of Java enabled applications, including J2EE or Web applications, to generate dynamic content.

Its main purpose is to help creating page oriented, ready to print documents in a simple and flexible manner.

JasperReport Home : http://jasperforge.org/sf/projects/jasperreports

06 July 2007

J2EE MVC Frameworks (Open Source )

Popular Frameworks

1. Spring Framework
2. Struts Framework
3. JavaServerFace (jsf)

Spring Framework

Introducing Spring is harder than most frameworks because it's not a single-purpose technology. Spring can be thought of as a huge framework of best practices for almost every area of Java software development. Everything from Plain-Old-Java-Object (POJO) development, to web application development, to enterprise application development, to persistence layer management and aspect oriented programming (AOP). Spring supports it all and does so with some of the most well designed and heavily tested code in the Java industry.

Because of its size, we need to focus this tutorial on the simplest application of Spring which is POJO development utilizing dependency injection. To clarify, dependency injection is a mechanism by which Spring handles creation and initializaton of the proper type of child object for a parent object at the moment the parent object needs the reference to the child. An example of where this is useful in the context of enterprise Java programming would be for your web application to instantly have access to your data-access layer in order to read or write an object from the database. This is a classic example of allowing Spring to inject the reference to the data-access layer into a POJO in the web application in order to load or save an object.

To immediately demystify any all-knowing magic from your minds about this process, the way this is done in the Spring is that the object reference relationships are mapped out in XML configuration files in Spring 1.2 and handled with Java 5 annotations in Spring 2.0.

Using this declarative method, Spring developers can actually soft-wire their application portions together using these annotations or XML configuration files such that when the application runs, Spring creates and instantiates all the object relationships "on demand". The advantage to having everything soft-wired is that portions of an application can quickly and easily be swapped out for alternative implementations (e.g. testing implementations) by simply changing around the annotations or XML configuration information and rerunning the application. There isn't even a need to recompile the application in some cases. This can be a huge boon to developers working on large applications that require constant testing or when delivering a larger application in interations. Spring provides a very natural way to thinking about these problems encouraging you to maintain your application in a modular architecture that supports this plugging and unplugging capability.

Spring Home : http://www.springframework.org/

Popular Tutorials

Tutorial Site -myeclipse

Tutorial Site -SpringHome
Tutorial Site-Roseindia



Struts

What Is the Struts Framework?

The Struts Framework is a standard for developing well-architected Web applications. It has the following features:

  • Open source
  • Based on the Model-View-Controller (MVC) design paradigm, distinctly separating all three levels:
    • Model: application state
    • View: presentation of data (JSP, HTML)
    • Controller: routing of the application flow
  • Implements the JSP Model 2 Architecture
  • Stores application routing information and request mapping in a single core file, struts-config.xml
The Struts Framework, itself, only fills in the View and Controller layers. The Model layer is left to the developer.

Struts is a popular open source framework from Apache Software Foundation to build web applications that integrate with standard technologies such as Servlets, Java Beans and Java Server pages.

Struts offers many benefits to the web application developer,including the Model-View-Controller (MVC) design patterns (best practice) in web applications.

The Model-View-Controller paradigm applied to web applications lets you separately display code (for example, HTML and tag libraries) from flow control logic (action classes) from the data model to be displayed and updated by the application.

Struts offers a set of tag libraries to support the faster development of the different layers of the web application.

The basic idea of the MVC architecture is to divide the application into three layers: Model that represents the data layer, a view layer that represents the data processed by the model component; and a Controller component that is responsible for interaction between the model and the controller.

So when we say Struts is an MVC framework for web based applications, we actually mean that it facilitates the rapid development of applications by providing a Controller that helps interaction between the model and the view so that an application developer has not to worry about how to make view and the model independent of each other and yet exist in coordination.


Struts Home http://struts.apache.org

Popular Struts Tutorial

Ttorial Site- Roseindia

Ttorial Site-visualbuilder

Ttorial Site-laliluna

Ttorial Site-exadel.


JSF

JavaServer Faces technology simplifies building user interfaces for JavaServer applications. Developers of various skill levels can quickly build web applications by: assembling reusable UI components in a page; connecting these components to an application data source; and wiring client-generated events to server-side event handlers.

What Is JavaServer Faces?

  • Page navigation specification
  • Standard user interface components like input fields, buttons, and links
  • User input validation
  • Easy error handling
  • Java bean management
  • Event handling
  • Internationalization support
JSF Home : http://java.sun.com/javaee/javaserverfaces/

Populat JSF Tutorials

Ttorial Site-coreservlets.com

Ttorial Site-exadel

Ttorial Site-java.sun

Ttorial Site-jsftutorials

Ttorial Site-roseindia