Web Framework and Struts 2 - KNOWARTH

15
SLIDE TITLE Click to edit Master text styles Second level Third level Fourth level Fifth level By Jaydip Lakhatariya Web framework and Struts 2 © 2015 KNOWARTH

Transcript of Web Framework and Struts 2 - KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

By Jaydip Lakhatariya

Web framework and Struts 2

© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

▪ Traditional JSP/Servlet Web Application

▪ MVC Pattern

▪ MVC with JSP/Servlet

▪ Web frameworks

▪ Overview of Struts 2

▪ Features

▪ Architecture of struts

▪ Comparison

Agenda

2© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

• Servlet with only some special methods (doGet(), doPost(), …)

• JSPs (Java Server Pages) : HTML (or other) code with embedded Java code (Scriptlets)

• JSPs with JSTL (JSP Standard Tag Library)

Traditional JSP/Servlet Web Application

3© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

▪ Splits up responsibilities for handling user interactions in an application into

three layers:

▪ Model

▪ View

▪ Controller

The Model-View-Controller Pattern

4© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

Traditional JSP/Servlet Web Application

5

Servlet Jsp files

Java functions

© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth 6© 2015 KNOWARTH

Web framework

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

• A piece of structural software

• Make generalizations about the common tasks and workflow of a specific domain.

• Provide a platform upon which applications can be more quickly built

• Automate some tedious tasks of the domain.

• Introduce an elegant architectural solution.

• Provides rich set of features

• Frameworks would save time and resource.

Web Frameworks

7© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

Web Frameworks

8© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

▪ An open-source web application framework

▪ Based on the MVC design pattern

▪ Uses and extends the Java Servlet API to adopt model–view–controller

(MVC) architecture.

▪ Favors convention over configuration.

▪ Many supported third-party tools

▪ Flexible & Expandable

▪ Rich tag library

▪ Large User Community

Struts 2 framework

9© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

• POJO forms and POJO actions

• Tag support

• AJAX support

• Easy Integration (Spring, tiles, sitemesh)

• Template Support

• Plugin Support

• Profiling

• Easy to modify tags

• Promote less configuration

• Various Result Types

Features

10© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

• Action

• Interceptors

• View

• Configuration files (struts.xml, web.xml, struts.properties)

Components

11© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

Architechture

12© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

Request life cycle

13© 2015 KNOWARTH

1. User sends a request to the server for requesting for some resource (i.e pages).

2. The FilterDispatcher looks at the request and then determines the appropriate

Action.

3. Configured interceptors functionalities applies such as validation, file upload etc.

4. Selected action is executed to perform the requested operation.

5. Again, configured interceptors are applied to do any post-processing if required.

6. Finally the result is prepared by the view and returns the result to the user.

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

© 2013 Knowarth

Comparision

14

Struts 2 Spring

Ajax support Yes No

Rich tag library Yes No

Community Has wide availability Behind struts

Transaction management

No Yes

Lightweight framework No Yes

Design perspective Not strong as spring Strong

Tools No Spring IDE

© 2015 KNOWARTH

SLIDE TITLE

▪ Click to edit Master text styles

▪ Second level

▪ Third level

▪ Fourth level

▪ Fifth level

THANK YOU

© 2015 KNOWARTH