Friday, April 25, 2008

Web Frameworks

Open Source AJAX Frameworks

Google Web Toolkit

Google Web Toolkit (GWT) makes it easier to write high-performance AJAX applications. You write your front end in the Java programming language and GWT compiles your source into highly optimized JavaScript. Writing web apps today is a tedious and error-prone process. You spend 90% of your time working around browser quirks, and JavaScript's lack of modularity makes sharing, testing, and reusing AJAX components difficult and fragile.


ThinWire® is an LGPL open source, free for commercial use, development framework that allows you to easily build applications for the web that have responsive, expressive & interactive user interfaces without the complexity of the alternatives. While virtually any web application can be built with ThinWire®, when it comes to enterprise applications, the framework excels with its highly interactive and rich user interface components. Use ThinWire® to handle the view-layer of your Java EE (J2EE) application and you'll be able to provide an unparalleled user experience, while at the same time completing your project faster than ever.

Direct Web Remoting

DWR allows Javascript in a browser to interact with Java on a server and helps you manipulate web pages with the results.

DWR is Easy Ajax for Java

Open Source J2EE/Web Frameworks


Spring Framework, the leading full-stack Java/JEE application framework. Led and sustained by SpringSource, Spring delivers significant benefits for many projects, increasing development productivity and runtime performance while improving test coverage and application quality.


AppFuse is an open source project and application that uses open source tools built on the Java platform to help you develop Web applications quickly and efficiently. It was originally developed to eliminate the ramp-up time found when building new web applications for customers. At its core, AppFuse is a project skeleton, similar to the one that's created by your IDE when you click through a wizard to create a new web project.


Apache Struts is a free open-source framework for creating Java web applications.

Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines to customize a response.

Web applications based on JavaServer Pages sometimes commingle database code, page design code, and control flow code. In practice, we find that unless these concerns are separated, larger applications become difficult to maintain.

One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.

The framework provides three key components:

* A "request" handler provided by the application developer that is mapped to a standard URI.
* A "response" handler that transfers control to another resource which completes the response.
* A tag library that helps developers create interactive form-based applications with server pages.

The framework's architecture and tags are buzzword compliant. Struts works well with conventional REST applications and with nouveau technologies like SOAP and AJAX.


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.


Tapestry divides a web application into a set of pages, each constructed from components. This provides a consistent structure, allowing the Tapestry framework to assume responsibility for key concerns such as URL construction and dispatch, persistent state storage on the client or on the server, user input validation, localization/internationalization, and exception reporting. Developing Tapestry applications involves creating HTML templates using plain HTML, and combining the templates with small amounts of Java code using (optional) XML descriptor files. In Tapestry, you create your application in terms of objects, and the methods and properties of those objects -- and specifically not in terms of URLs and query parameters. Tapestry brings true object oriented development to Java web applications.

Open Source Persistence Frameworks


Apache Cayenne is an open source persistence framework licensed under the Apache License, providing object-relational mapping (ORM) and remoting services.With a wealth of unique and powerful features, Cayenne can address a wide range of persistence needs. Cayenne seamlessly binds one or more database schemas directly to Java objects, managing atomic commit and rollbacks, SQL generation, joins, sequences, and more. With Cayenne's Remote Object Persistence, those Java objects can even be persisted out to clients via Web Services. Or, with native XML serialization, objects can be even further persisted to non-Java clients - such as an Ajax-capable browser.


The iBATIS framework will help to significantly reduce the amount of Java code that is normally needed to access a relational database. This framework maps JavaBeans to SQL statements using a very simple XML descriptor.

Every iBATIS implementation includes these basic components...

The iBATIS Data Mapper provides a very simple and flexible means of moving data between your Java and .NET objects and a relationaldatabase. Use the full power of real SQL without a single line of JDBC or ADO.NET code!

iBATIS Data Access Objects is an abstraction layer that hides the details of your persistence solution and provides a common API to therest of your application.

PetStore is a fully functional web application based on iBATIS open source persistence layer products, including theSQL Maps and Data Access Objects frameworks.


Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java. Hibernate lets you develop persistent objects following common Java idiom - including association, inheritance, polymorphism, composition and the Java collections framework. Extremely fine-grained, richly typed object models are possible. The Hibernate Query Language, designed as a "minimal" object-oriented extension to SQL, provides an elegant bridge between the object and relational worlds.

Further Reading

Wednesday, April 9, 2008

Configuring PHP on Tomcat


PHP Version 5.2.5
Tomcat Version 5.5.25

Let's assume that your current Tomcat install can be found in c:\Tomcat5\

Download PHP and PECL

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

1. Surf to and download the current version of PHP for Windows machine.
2. Download the corresponding PECL modules.

Configure Tomcat

1. Create a c:\Tomcat5\php\ directory and unzip the PHP zip file in it.
2. Rename php.ini-dist, in c:\Tomcat5\php\, to php.ini
3. Extract php5servlet.dll from the PECL zip file to c:\Tomcat5\php\
4. Create a directory under c:\Tomcat5\webapps\; in our case: phptest
5. In c:\Tomcat5\webapps\phptest\, create a subdirectory: WEB-INF
6. In c:\Tomcat5\webapps\phptest\WEB-INF\,
create web.xml with the following content:

7. Rename php5servlet.dll to php5srvlt.dll.
8. Copy c:\Tomcat5\php\ php5srvlt.dll and c:\Tomcat5\php\php5ts.dll to c:\windows\system32\
9. Create a test page in c:\Tomcat5\webapps\phptest\test.php with this contents:

10. (For Tomcat 4.x copy phpsrvlt.jar c:\Tomcat4\php to c:\Tomcat4\lib)

Run PHP in Tomcat

Start Tomcat and go to http://localhost:8080/phptest/test.php