Academic Tutorials



English | French | Portugese | German | Italian
Home Advertise Payments Recommended Websites Interview Questions FAQs
News Source Codes E-Books Downloads Jobs Web Hosting
Chats

Struts Tutorial
Struts Introduction
Struts Controller
Struts Action Class
Struts ActionForm Class
Struts HTML Tags
Struts Validator Framework
Struts ClientSide Address Valiadation
Struts Tiles
Using tiles-defs.xml
Dynamic Action Form
Struts File Upload
Struts Database Connection

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting
Network Sites


Introduction to Struts

home Next




  • For creating Java web application,Apache Struts is used which is a free open-source framework



  • A D V E R T I S E M E N T
    The framework provide three key components which are as follows:
    • A "request" handler is provided by the application developer that is mapped to the standard URI .

    • A "response" handler which is responsible to transfer control to another resource which completes the response.

    • A tag library is used to help developer create interactive form-based applications with server pages.




    What is Struts?

    Model-View-Controller (MVC) design pattern is used by Struts Framework which is the implementation of the JSP. Struts is open source and is also maintained as a part of Apache Jakarta project. Struts Framework is well suited for application of any size.




    Major Versions of Struts

    Two major versions of Struts framework is offered by the Apache Struts Project. For the Java,Struts 1 is recognized as the most popular web application framework. The struts 1.x framework is the mature, well-documented, and widely supported. Struts 1 is the best choice for the teams who value proven solutions to common problems.

    Other name of Struts 2 was WebWork 2. The WebWork and the Struts communities joined forces to create Struts 2 after working independently for several years. For teams who value elegant solutions to difficult problems,the new framework is best choice .

    In the fourth quarter of the 2006,a stable release of Struts 2 is expected . A BETA release is also available now.




    The Six Basic Steps in Using Jakara Struts

    1. Modify struts-config.xml.

      In addition to forward and action elements used to specify the destination URLs and Action object, we use the form-bean element to declare form beans. We also add the scope and name attributes to the action element to tie the form bean to the Action. Optionally, to declare a properties file containing the standard messages, names, and labels,we add a message-resources element .



    2. Define a form bean.

      This bean has the properties (i.e., getter and setter methods) corresponding to each of the incoming request parameters and normally extends ActionForm and . Alternatively,in which case it will contain a Map representing the request parameters, the bean can extend the DynaActionForm.



    3. Create results beans.

      These are normal beans of which is used in MVC when implemented directly with RequestDispatcher. That is, they represent the data access code and results of the business logic. These beans are stored in request, session, or application scope with the use of setAttribute method of HttpServletRequest, HttpSession, or ServletContext, just as in the normal non-Struts applications.



    4. Create an Action object to handle requests.

      Rather than calling request.getParameter explicitly as in the previous example, we can use the execute method casts the ActionForm argument to the specific form bean class, then uses getter methods to access the properties of the object.



    5. Create form that invokes blah.do.

      This form can use the bean:message tag to output text labels and standard messages that are defined in the properties file that is declared with the message-resources in struts-config.xml



    6. Display results in JSP.

      The JSP page uses the bean:write tag to output properties of the result bean and form bean . It may also use the bean:message tag to output text labels and standard messages that are defined in standard properties file.




    Advantages of Using Struts

    • Centralized File-Based Configuration.

      Rather than hard-coding information into Java programs, many Struts values are represented in the property or XML files. This loose coupling means that many changes can be made without recompiling or modifying the Java code, and that wholesale changes can be made by editing a single file. This approach also lets Web developers and Java focus on their specific tasks (implementing business logic, presenting certain values to clients, etc.) without needing to know about overall system layout.



    • Form Beans.

      In JSP,To automatically populate a JavaBean component based on the incoming request parameters, you can use property="*" with jsp:setProperty . Unfortunately, however, in the standard API this capability is unavailable to the servlets, even though with MVC it is really servlets, not JSP pages, that should usually be the target of form submissions. Apache Struts extends this capability to Java code and adds in several useful utilities, all of which serve to greatly simplify the processing of the request parameters.



    • Bean Tags.

      Apache Struts provides a set of custom JSP tags (bean:write, in particular) that let you easily output the properties of JavaBeans component. Basically, these are concise and powerful variations of standard jsp:useBean and jsp:getProperty tags.



    • HTML Tags.

      Apache Struts provides a set of custom JSP tags to create HTML forms that are associated with the JavaBeans components. This bean/form association serves two useful purpose:

      • It lets you get initial form-field values from the Java objects.
      • It lets you to redisplay forms with some or all previously entered values intact.


    • Form Field Validation.

      Apache Struts has builtin capabilities for checking that form values are in required format. If values are missing or in an improper format, the form can be automatically redisplayed with the error messages and with the previously entered values maintained.
          This validation can be performed on server (in Java), or both on server and on client (in JavaScript).



    • Consistent Approach.

      Struts encourages consistent use of MVC throughout of your application




    Disadvantages of Using Struts

    • Bigger Learning Curve.

      To use MVC with the standard RequestDispatcher, you need to be comfortable with the standard JSP and servlet API and a large and elaborate framework that is almost equal in size to the core system. This drawback is especially significant with smaller project, near-term deadlines, and less experienced developers; you could spend as much time learning Struts as building your actual system.



    • Worse Documentation.

      Compared to the standard servlets and JSP APIs, Struts has fewer online resources, and many first-time users find the online Apache documentation confusing and poorly organized. There are also fewer books on the Apache Struts than on standard servlets and JSP.



    • Less Transparent.

      With Struts applications, there is a lot more going on behind scenes than with normal Java-based Web applications. As a result, Struts applications always are:

      • Harder to benchmark and optimize
      • Harder to understand


    • Rigid Approach.

      The flip side of the benefit that Struts encourages a consistent approach to MVC is that Struts makes it difficult to use other approaches.




    What You Should Already Know

    Before you goes to this tutorial you should have a basic understanding of the following:

    • HTML
    • A basic understanding of JAVA
    • JSP
    • Servlets
    • JDBC
    • Custom Tags

    If you are going to study these subjects first, find the tutorial on our Home page



    Be the first one to comment on this page.




      Struts Tutorial eBooks

    No eBooks on Struts could be found as of now.

     
     Struts Tutorial FAQs
    More Links » »
     
     Struts Tutorial Interview Questions
    More Links » »
     
     Struts Tutorial Articles
    More Links » »
     
     Struts Tutorial News
    More Links » »
     
     Struts Tutorial Jobs
    More Links » »

    Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
    • blinkbits
    • BlinkList
    • blogmarks
    • co.mments
    • connotea
    • del.icio.us
    • De.lirio.us
    • digg
    • Fark
    • feedmelinks
    • Furl
    • LinkaGoGo
    • Ma.gnolia
    • NewsVine
    • Netvouz
    • RawSugar
    • Reddit
    • scuttle
    • Shadows
    • Simpy
    • Smarking
    • Spurl
    • TailRank
    • Wists
    • YahooMyWeb

    home Next

    Keywords: jakarta struts jsp, web applications, struts 1.1,programming jakarta struts,java struts,struts tutorial

    HTML Quizzes
    HTML Quiz
    XHTML Quiz
    CSS Quiz
    TCP/IP Quiz
    CSS 1.0 Quiz
    CSS 2.0 Quiz
    HLML Quiz
    XML Quizzes
    XML Quiz
    XSL Quiz
    XSLT Quiz
    DTD Quiz
    Schema Quiz
    XForms Quiz
    XSL-FO Quiz
    XML DOM Quiz
    XLink Quiz
    XQuery Quiz
    XPath Quiz
    XPointer Quiz
    RDF Quiz
    SOAP Quiz
    WSDL Quiz
    RSS Quiz
    WAP Quiz
    Web Services Quiz
    Browser Scripting Quizzes
    JavaScript Quiz
    VBScript Quiz
    DHTML Quiz
    HTML DOM Quiz
    WMLScript Quiz
    E4X Quiz
    Server Scripting Quizzes
    ASP Quiz
    PERL Quiz
    SQL Quiz
    ADO Quiz
    CVS Quiz
    Python Quiz
    Apple Script Quiz
    PL/SQL Quiz
    SQL Server Quiz
    PHP Quiz
    .NET (dotnet) Quizzes
    Microsoft.Net Quiz
    ASP.Net Quiz
    .Net Mobile Quiz
    C# : C Sharp Quiz
    ADO.NET Quiz
    VB.NET Quiz
    VC++ Quiz
    Multimedia Quizzes
    SVG Quiz
    Flash Quiz
    Media Quiz
    SMIL Quiz
    Photoshop Quiz
    Gimp Quiz
    Matlab Quiz
    Gnuplot Programming Quiz
    GIF Animation Quiz
    Scientific Visualization Quiz
    Graphics Quiz
    Web Building Quizzes
    Web Browsers Quiz
    Web Hosting Quiz
    W3C Quiz
    Web Building Quiz
    Web Quality Quiz
    Web Semantic Quiz
    Web Careers Quiz
    Weblogic Quiz
    SEO Quiz
    Web Site Hosting Quiz
    Domain Name Quiz
    Java Quizzes
    Java Quiz
    JSP Quiz
    Servlets Quiz
    Struts Quiz
    EJB Quiz
    JMS Quiz
    JMX Quiz
    Eclipse Quiz
    J2ME Quiz
    JBOSS Quiz
    Programming Langauges Quizzes
    C Quiz
    C++ Quiz
    Visual Basic Quiz
    Data Structures Using C Quiz
    Cobol Quiz
    Assembly Language Quiz
    Mainframe Quiz
    Forth Programming Quiz
    Lisp Programming Quiz
    Pascal Quiz
    Delphi Quiz
    Fortran Quiz
    OOPs Quiz
    Data Warehousing Quiz
    CGI Programming Quiz
    Emacs Quiz
    Gnome Quiz
    ILU Quiz
    Soft Skills Quizzes
    Communication Skills Quiz
    Time Management Quiz
    Project Management Quiz
    Team Work Quiz
    Leadership Skills Quiz
    Corporate Communication Quiz
    Negotiation Skills Quiz
    Database Quizzes
    Oracle Quiz
    MySQL Quiz
    Operating System Quizzes
    BSD Quiz
    Symbian Quiz
    Unix Quiz
    Internet Quiz
    IP-Masquerading Quiz
    IPC Quiz
    MIDI Quiz
    Software Testing Quizzes
    Testing Quiz
    Firewalls Quiz
    SAP Module Quizzes
    ERP Quiz
    ABAP Quiz
    Business Warehousing Quiz
    SAP Basis Quiz
    Material Management Quiz
    Sales & Distribution Quiz
    Human Resource Quiz
    Netweaver Quiz
    Customer Relationship Management Quiz
    Production and Planning Quiz
    Networking Programming Quizzes
    Corba Quiz
    Networking Quiz
    Microsoft Office Quizzes
    Microsoft Word Quiz
    Microsoft Outlook Quiz
    Microsoft PowerPoint Quiz
    Microsoft Publisher Quiz
    Microsoft Excel Quiz
    Microsoft Front Page Quiz
    Microsoft InfoPath Quiz
    Microsoft Access Quiz
    Accounting Quizzes
    Financial Accounting Quiz
    Managerial Accounting Quiz
    Testimonials | Contact Us | Link to Us | Site Map
    Copyright ? 2008. Academic Tutorials.com. All rights reserved Privacy Policies | About Us
    Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Webhosting in India | Dedicated Server in India | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World | Important Websites
    Copyright ? 2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved.