Tuesday, June 26, 2007

Struts Advantages

Centralized File-Based Configuration - Rather than hard-coding information into Java programs, many Struts values are represented in XML or property files. This loose coupling means that many changes can be made without modifying or recompiling Java code, and that wholesale changes can be made by editing a single file.

Apache Struts provides a set of custom JSP tags that let you easily output the properties of JavaBeans components.

In older JSP and Servlets - It's just whether you want to spend your time defining JavaBeans or cutting and pasting code snippets between JSPs.

Gain both flexibility and functionality
The Struts forms could then read and set the fields on the rowset, and the rowset could be used to update the model directly when it was returned. No additional hand-offs.

Rather than hard-coding information into Java programs, many Struts values are represented in XML or property files. This loose coupling means that many changes can be made without modifying or recompiling Java code.

Java and Web developers focus on their specific tasks (implementing business logic, presenting certain values to clients, etc.) without needing to know about the overall system layout.

To change the appearance of an MVC-based component, all you have to change is its view part. To change the way it responds to user events, all you have to change is its controller part. In this way, you can equip a component with multiple appearances, multiple behaviors, or both, without disturbing the component's underlying architecture.

  1. Multiple views using the same model
  2. Easier support for new types of clients
  3. Clarity of design
  4. Efficient modularity
  5. Ease of growth
  6. Distributable

Saturday, June 9, 2007

Struts Intro

Struts is the premier framework for building Java-based web applications. It's using Model-View-Controller design pattern, so that the developers concentrate on its structure.

History:

Initially CGI Scripts used for dynamic content. But CGI creates new process per request, but in the case servlets can be used multithreaded concept for avoids making new process per request. But later on JSP simplifies the work on dynamic pages.

Models:

Sun introduced JSP Technology at the same time it introduces two models i.e, Model 1 and Model 2

Model1 :

In Model 1, business logic, controller and data access are in the same unit. It can not be a complexity in smaller web applications. If we consider larger, it have some chaos.

Model 2:

Model 2 architecture known as MVC Architecture. In the MVC Architecture, a Central servlet known as the controller, receives all request for the application. The controller than process the request and work with the model to prepare any data needed by the View and forwards the data to a JSP.