• Like
Struts2
Upcoming SlideShare
Loading in...5
×
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,631
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
77
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Struts 2
  • 2. Contents
    • What is Struts?
    • Why to use framework?
    • Struts 2 Overview
    • Struts 2 MVC components
    • Request Lifecycle in Struts 2
    • Struts 2 Architecture
    • Sample Application
    • Why we should use Struts 2?
    • Struts 1 vs Struts 2
    • What you need to start using Struts2.
  • 3. What is Struts?
    • Open Source java framework for creating web applications.
    • Action Based Framework
    • Create web application using MVC 2 architecture
    • Apache Struts offer two major version
        • Struts 1.x
        • Struts 2.0
    • Struts 2 = WebWork + Struts
  • 4. Why use framework?
    • Do we need framework?
    • No and Yes.
    • No.
    • In small applications where you don’t want the overhead of learning new things.
    • But
    • Yes
    • We have to use framework in real world application because:-
      • Automation of common tasks
      • Concentrate on higher level concerns.
  • 5. Struts 2
    • Complete new framework based on webwork framework.
    • Struts 2 implements MVC 2 design pattern.
  • 6. Struts 2 MVC Components
    • Controller:-
    • Filter Dispatcher:-
      • First component that start processing that is why this type of MVC is called front controller MVC
      • Looks at the request and apply the appropriate action.
      • Struts framework handles all of the controller work.
      • Its configured in web.xml
    • Interceptors:-
      • Can execute code before and after an Action is executed.
      • They can be configured per action basis.
      • Can be used for data validation, file upload, double submit guards.
  • 7. Struts 2 MVC Components contd.
    • Model:-
      • Implemented by action class
      • For model you can use any data access technologies like JDBC,EJB,Hibernate
    • View
      • Its your result part. It can be JSP,JSTL,JSF etc.
      • Presentation part of the MVC
  • 8. Request Lifecycle in Struts 2
    • User Sends Request
    • Filter Dispatcher determines the appropriate action
    • Interceptors are applied
    • Execution of action
    • Output Rendering
    • Return of Request
    • Display of result to user.
  • 9. Struts 2 Architecture
  • 10. Why we should use Struts 2?
    • Simplified Design
    • Simplified Action
    • Simplified Testability
    • Better tag features
    • Annotation introduced
    • Easy plug-in
    • AJAX Support
  • 11. Struts 1 vs Struts 2
    • How Struts 1 and Struts 2 differ from each other?
      • Configuration
      • Action Class
      • Dependency injection.
      • Servlet Dependency
      • Validation
      • Threading model
      • Testability
      • Expression Language
  • 12. What you need to start using Struts 2?
    • Java 5.0
    • Tomcat 5.x(Servlet api 2.4 and jsp api 2.0)
  • 13.
    • Thank You All.