Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
What is Struts - Struts Architecturec 
 

In this section we will discuss about Architecture. Struts is famous for its robust Architecture and it is being used for developing small and big software projects.

 

What is Struts - Struts Architecture

                         

In this section we will discuss about Architecture. Struts is famous for its robust Architecture and it is being used for developing small and big software projects. 

Struts is an open source framework used for developing J2EE web applications using Model View Controller (MVC) design pattern. It uses and extends the Java Servlet API to encourage developers to  adopt an MVC architecture. Struts framework provides three key components:

  1. A request handler provided by the application developer that is used to  mapped to a particular URI.
  2. A response handler which is used to transfer the control to another resource which will be responsible for completing the response.
  3. A tag library which helps developers to create the interactive form based applications with server pages.

Struts provides you the basic infrastructure infrastructure for implementing MVC allowing the developers to concentrate on the business logic.

MVC Architecture

The main aim of the MVC architecture  is to separate the business logic and application data from the presentation data to the user.

Here are the reasons why we should use the MVC design pattern.

  1. They are resuable : When the problems recurs, there is no need to invent a new solution, we just have to follow the pattern and adapt it as necessary.
  2. They are expressive: By using the MVC design pattern our application becomes more expressive.

1).  Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser.  

2). View : The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the of the view's to maintain the consistency in its presentation when the model changes.

3). Controller:  Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In  GUIs, the views and the controllers often work very closely together.

Overview of the Struts Framework

The Struts framework is composed of approximately 300 classes and interfaces which are organized in about 12 top level packages. Along with the utility and helper classes framework also provides the classes and interfaces for working with controller and presentation by the help of the custom tag libraries. It is entirely on to us which model we want to choose. The view of the Struts architecture is given below:

The Struts Controller Components:

Whenever a user request for something, then the request is handled by the Struts Action Servlet. When the ActionServlet receives the request, it intercepts the URL and based on the Struts Configuration files, it gives the handling of the request to the Action class. Action class is a part of the controller and is responsible for communicating with the model layer.

The Struts View Components:

The view components are responsible for presenting information to the users and accepting the input from them. They are responsible for displaying the information provided by the model components. Mostly we use the Java Server Pages (JSP) for the view presentation. To extend the capability of the view we can use the Custom tags, java script etc.

 The Struts model component:

The model components provides a model of the business logic behind a Struts program. It provides interfaces to databases or back- ends systems. Model components are generally a java class. There is not any such defined format for a Model component, so it is possible for us to reuse Java code which are written for other projects. We should choose the model according to our client requirement.

                         

» View all related tutorials
Related Tags: c programming apache web com development asp ui framework build application io components make sed get ip hook vi concepts

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

72 comments so far (
post your own) View All Comments Latest 10 Comments:

struts notes

Posted by suresh on Friday, 12.5.08 @ 02:30am | #82430

Very Informative...I would like to know about the how springs and struts are integrated.

Posted by Aurobindo Ghosh on Tuesday, 12.2.08 @ 07:05am | #82281

Its very simple and very clear. I hope it should very usefull for new programmers. Thenks for this tutorials.

Posted by Soundararajan.M on Saturday, 11.15.08 @ 09:03am | #81700

I'm Newer to the STRUTS,It'send me a simple example

Posted by chanaka on Friday, 11.14.08 @ 01:09am | #81666

Good day...
Can you please send me an example of a Struts program.
I need it to help me in my project relating to Struts.
Thanks in advance.

Posted by Max on Friday, 11.14.08 @ 00:59am | #81665

i want to know abt struts 2.0
can u send the material for struts2.0 (pdf).
if u have jakatra strutslive full version please send to my mail id.thank q

Posted by swaroop kumar on Sunday, 09.28.08 @ 00:22am | #80742

Hi! Please send Struts Examples to my Mail ID !

Posted by Prakash Karuppusamy on Friday, 09.26.08 @ 14:30pm | #80717

Hi im a new learner.Plz send me some pdf about struts.

Posted by Debahuti on Tuesday, 07.29.08 @ 14:21pm | #69760

I'm newer to struts.Easy to understand struts,What wil i do?Pls,anybody send me simple examples for that.
Thaks in advance

Posted by R.Rajalakshmi on Monday, 07.28.08 @ 23:42pm | #69614

Hi sir,I have to learn struts with WSAD using DB2 for my new project.I dont know anything about 3 of them.please mail the suitable material to my mail id and code of some sample applications if possible.

Posted by gurleen chopra on Wednesday, 06.11.08 @ 14:53pm | #63010

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.