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

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Struts Guide 
 

Struts Guide Struts Guide This tutorial is extensive guide to the Struts Framework. In this tutorial you will learn how to develop robust application using Jakarta Struts Framework. This tutorial assumes that the reader is familiar with the web

 

Struts Guide

                         

This tutorial is extensive guide to the Struts Framework. In this tutorial you will learn how to develop robust application using Jakarta Struts Framework. This tutorial assumes that the reader is familiar with the web application development with JSP, Servlets, JDBC and custom tags. To begin with let's understand the Jakarta Struts Framework.

What is Struts?

Struts Frame work is the implementation of Model-View-Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open source. Struts Framework is suited for the application of any size. Latest version of struts can be downloaded from http://jakarta.apache.org/. We are using jakarta-struts-1.1 and jakarta-tomcat-5.0.4 for this tutorial.

What is Model-View-Controller (MVC) Architecture?

Model-View-Controller architecture is all about dividing application components into three different categories Model, View and the Controller. Components of the MVC architecture has unique responsibility and each component is independent of the other component. Changes in one component will have no or less impact on other component. Responsibilities of the components are:

Model: Model is responsible for providing the data from the database and saving the data into the data store. All the business logic are implemented in the Model. Data entered by the user through View are check in the model before saving into the database. Data access, Data validation and the data saving logic are part of Model.

View: View represents the user view of the application and is responsible for taking the input from the user, dispatching the request to the controller and then receiving response from the controller and displaying the result to the user. HTML, JSPs, Custom Tag Libraries and Resources files are the part of view component.

Controller: Controller is intermediary between Model and View. Controller is responsible for receiving the request from client. Once request is received from client it executes the appropriate business logic from the Model and then produce the output to the user using the View component. ActionServlet, Action, ActionForm and struts-config.xml are the part of Controller.

Setting Up Development Environment

Installing JDK:

Download JDK 1.4 or above from sun site. Follow the instruction given in the installation manual and install JDK.

Installing Tomcat:

Download Tomcat from the apache site and install it. I have downloaded jakarta-tomcat-5.0.4 and installed for this tutorial. To  test your installation go to your installation directory/bin and issue startup command to run the server. Open browser and type http://localhost:8080/ to test the server. It should display the welcome page. If not consult tomcat documentation before going further.

Installing Struts Application:

Download latest version of Struts from the official site of Struts http://jakarta.apache.org/struts. Extract the file ito your favorite directory and copy struts-blank.war, struts-documentation.war and struts-example.war from "jakarta-struts-1.1\webapps" directtory into "jakarta-tomcat-5.0.4\webapps" directory.

struts-blank.war is the blank struts application which is useful in creating struts application from scratch. We will use this file to create our web application.

struts-documentation.war contains API and important documents for the struts application development.

struts-example.war is simple MailReader Demonstration Application.

Developing First Struts Application

Rename struts-blank.war  to struts-tutorial.war from jakarta-tomcat-5.0.4\webapps and copy it to the "jakarta-tomcat-5.0.4\webapps" directory. Tomcat automatically extracts the file and loads the application. 

Note: I have decided to use JBoss 3.2.3 for next parts as it is very easy to deploy the application in JBoss and I have developed the Ant script for easy deployment of the tutorial. The hot deployment feature of JBoss is very useful and it pickups the new ear files and deploys automatically.

You can download JBoss 3.2.3 from jboss.org. For installing and how to use JBoss please have a look at http://www.roseindia.net/jboss/index.shtml.
  

                         

» View all related tutorials
Related Tags: c exception time io scope multiple type request cookie default ip page value tag name attribute this oo row define

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

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

it's a very fabulous way to represent conceptual thinking about struts.
please describe this topic in more pactically approach.
thanks,
with regards
Nikhil garg
(MAISM,Jaipur)

Posted by Nikhil garg on Saturday, 01.31.09 @ 00:33am | #84343

http://www.roseindia.net/struts/strutsguide.shtml

it is useful.

Posted by abc on Wednesday, 12.10.08 @ 00:46am | #82582

struts is framework

Posted by siva on Monday, 12.8.08 @ 12:08pm | #82517

What is the diffrence between webserver(ex..weblogic)and web application server( tomcat 5.0)?

Posted by Pavan on Saturday, 11.29.08 @ 18:57pm | #82183

why struts is open source ?

Posted by deba on Saturday, 11.15.08 @ 09:51am | #81702

nice piece of tutorial!!!!
can understand easily!!!

Posted by hl on Wednesday, 10.8.08 @ 13:56pm | #80961

good,easy notes for begginers

Posted by rithwika on Tuesday, 08.5.08 @ 11:27am | #71048

I'm very much thankful 4 this(roseindia) people for providing valuable informations.....

Posted by SenthilKumar on Wednesday, 06.11.08 @ 20:31pm | #63042

very good site for struts freshers

Posted by RAJ on Tuesday, 06.3.08 @ 13:04pm | #61933

I think u need to put some more demos and assignments.
Like a miny project sort of thing.

Posted by Harsh Gautam on Thursday, 04.24.08 @ 13:58pm | #57786

Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
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.