SlideShare a Scribd company logo
1 of 8
Struts Ppt 1 - Presentation Transcript<br />STRUTS Jaya Prakash...<br />Struts Agenda<br />Software Crises<br />What is Framework<br />Model1,Model2<br />What is Struts<br />Why we need it<br />Why is it called as Struts<br />Advantages of Struts<br />Terminology of Struts<br />Architecture of Struts<br />Controller Elements & it’s Responsibilities<br />Model Elements & it’s Responsibilities<br />View Elements & it’s<br />Responsibilities<br />Struts sequence diagram<br />I18n<br />Disadvantages<br />Challenges Exist In Software Development & Software Crisis<br />Projects must be developed Quickly.<br />Projects must be in High-Quality.<br />Application Stability.<br />Better code Maintainability.<br />Lower Cost for Developing Application.<br />To solve above Challenges<br />The Software Development Community Introduced Frameworks to Guide Development.<br />* Time shown with out day light savings<br />What is Framework<br />A software framework is a re-usable design for a software system (or subsystem).<br />A framework is a pre-built assembly of components and is designed to be extended.<br />It is also base for components.<br />Advantages of Framework<br />Provide a procedure for the development of Application.<br />Saves developers Time.<br />Provides same approach for all developers for developing code and Consistency in Software Design<br />Provide low-level services that developers can use to speedup development.<br />It also reduces software development and maintenance costs.<br />Most of the frameworks follow Model1,Model2<br />Model 1<br />In the Model 1 the JSP page is responsible for processing the incoming request and replying back to the client.<br />Disadvantages of Model1<br />It does not have separate controller<br />This Architecture usually leads to a significant amount of Java code embedded within the JSP page<br />Model 1 architecture is suitable for applications that have very simple page flow, have little need for centralized and change little over time.<br />Developers Designers JSP<br />Developers and designers must work on the same files!<br />Model 2<br />This Model2 approach combines the use of both servlets and JSP, using JSP to generate the presentation layer and servlets to perform process-intensive tasks.<br />Model2 architecture introduces a Servlet between the browser and the JSP pages.<br />The servlet acts as the controller and is in charge of the request processing and the creation of any beans or objects used by the JSP, as well as deciding, depending on the user's actions, which JSP page to forward the request to.<br />Model2 Advantages<br />No processing/business logic within the JSP page.<br />Model 2 applications are easier to maintain and extend, because views do not refer to each other directly.<br />The Model 2 controller servlet provides a single point of control for security and often encapsulates incoming data into a form usable by the back-end MVC model.<br />It also Provides unique responsibility to each component and each is independent of the other component .<br />Change in one component will have no or less impact on other components.<br />Model 2 Components and Responsibilities<br />Model<br />The Model portion of an MVC-based System responsible for internal state of the system, and actions that can be taken to change that state<br />Decide “ How to do ”<br />Controller<br />-Decide “ What to do ”<br />-The Controller portion of the application is focused on receiving requests from the client ,deciding what business logic is to be performed ,and then delegating responsibility for producing the next phase of user interface to an appropriate View Component<br />View<br />Presentation<br />What is Struts<br />An open source web application framework based on j2ee and java which implements the MVC design pattern is called Struts.<br />Why is it called as Struts<br />Strut synonym is Iron-rod.<br />Why we use and what are the advantages of Struts<br />It is open source.<br />Provides components for building Web Applications that speedup development and saves time for developers.<br />It makes complex applications into simple.<br />Built in Exception Handling<br />I18n support with resource bundles.<br />Built in validation framework.<br />It also have tiles framework (A template mechanism incorporated into struts for managing page layouts.)<br />Struts Architecture<br />Struts Framework Components<br />Controller Components - Direct the Action<br />Model Components - Access Data and Systems<br />View Components - What the users see<br />Struts Controller Components<br />Struts-config.xml<br />Actionservlet and Requestprocessor<br />Receive the HttpServletRequest<br />Automatically populate a JavaBean from the request parameters.<br />Handle Locale Issues<br />Determine which Action to invoke based on URI<br />Extends javax.servlet.http.HttpServlet<br />Receives all framework requests<br />Selects proper application module<br />Delegates request handling to the RequestProcessor instance<br />One ActionServlet instance per web application<br />Default implementation provided by Framework<br />Actionservlet and Requestprocessor<br />ActionServlet dispatch request to Request Processor(New from 1.1. previous this behaviour was in Action servlet)<br />The work of Request Processor is:-<br />Finding ActionMapping.<br />Mapping Action to FormBean.<br />Creating FormBean Object.<br />Calling reset() method of FormBean<br />Calling Validator of FormBean<br />If no form(jsp/html) validation errors calls execute method in Action Class and finding response to request.<br />If Errors give the errors on jsp present in input attribute of Action tag in struts-config.xml.<br />What is An Action Class<br />Extends org.apache.struts.action.Action<br />Overrides the execute() method<br />Acts as a bridge between user-invoked URI and a business method<br />Return information about which view should be rendered next<br />Part of the Controller ,not the Model<br />Actionclass Example<br />Struts-Config.xml<br />The power and flexibility of struts is due to the extracting of configuration information from across frame work.<br />Configuration file contains action mappings (determines navigation)<br />Controller uses mappings to turn HTTP requests into application actions<br />Mapping must specify<br />A request path<br />Object type to act upon the request<br />Tags in this file are:-<br />Data Sources.<br />Form Beans.<br />Global Exceptions.<br />Global Forwards<br />Actions<br />Controller<br />Message resources<br />Plug-in<br />Struts- Config.xml Example<br />The Model Components<br />Model Components<br />Java classes<br />middle tier components (EJB, Javabeans, …)<br />database access components<br />Used to represent the Internal state of the system<br />Actions that can change that state<br />Internal state of system represented by<br />JavaBeans<br />Enterprise JavaBeans<br />Action Form<br />Extends the ActionForm class<br />Create one for each input form in the application<br />It is just like a java bean, Store data temporary, reset default values to views, validate input view.<br />Hold state and behavior for user input.<br />If defined in the ActionMapping configuration file, the Controller Servlet will perform the following:-<br />Check for instance of bean of appropriate class<br />If no bean exists, one is created automatically<br />For every request parameter whose name corresponds to the name of a property in the bean, the corresponding setter method will be called<br />The updated ActionForm bean will be passed to the Action Class execute () method when it is called, making these values immediately available.<br />ActionForm Example<br />The View Components<br />Struts JSP Tag Libraries<br />HTML<br />Bean<br />Logic<br />Nested<br />Tiles<br />Template<br />Html Tag & Bean Tag Libraries<br />Tags used to create Struts input forms<br />Examples (checkbox,image,<br />link, submit ,text, text area)<br />Tags used for accessing JavaBeans and their properties<br />Examples (Define,message,write)<br />Logic ,Tiles & Nested Tag Libraries<br />Managing conditional generation of output text<br />Looping over object Collections for repetitive generation of output text<br />Example (empty,lessThan,<br />greaterThan)<br />Extended the base struts tags to allow them to relate to each other in nested nature<br />Tiles tags<br />Each part (&quot;Tile&quot;) of webpage can be reused as often as needed throughout your application. This reduces the amount of markup that needs to be maintained and makes it easier to change the look and feel of a website.<br />Template Tag Library<br />The &quot;struts-template&quot; tag library contains tags that are useful in creating dynamic JSP templates for pages which share a common format. These templates are best used when it is likely that a layout shared by several pages in your application will change. The functionality provided by these tags is similar to what can be achieved using standard JSP include directive , but are dynamic rather than static.<br />Note: As of Struts 1.1 the template library has been deprecated<br />Action Message & Action Error<br />Used to signify general purpose informational and error messages<br />Rely on the resource bundles<br />JSP Tags can access them<br /></html:errors><br />Internationalization Support<br />Much of the framework functionality based on java.util.Locale<br />Struts Uses Java Resource Bundles .<br />Ex:-<br />Date ,Time and Currency Formatting<br />Currency Conversion<br />Resource Bundle Example<br />Other Features Suported by Struts Framework<br />Multi-Module Support<br />Declarative Exception-Handling<br />Dynamic Action Forms<br />Plugins<br />Tiles integrated With Core<br />Validator Integrated With Core<br />Struts Sequence Diagram<br />Struts Example<br />0.167.192.116login_app<br />Webapps|<br />|sample(Application Name)<br />|__ login.jsp<br />|__newLogin.Jsp<br />|__success.jsp<br />|__WEB-INF<br />|__web.xml<br />|__Struts-config.xml<br /> All the struts tld files|__*.tld <br />|__lib<br /> All the jar files|__*.jar <br />|__classes<br />|__LoginAction,LoginForm,<br />Messageresorces<br />Disadvantages<br />Bigger Learning Curve<br />Not Based on Domain Model<br />Property Names<br />Views are restricted .<br />Questions & Answers QUESTIONS & ANSWERS What did I Miss?<br />Thank u mail me:-jayaprakash.m.java@gmail.com<br />
Struts ppt 1
Struts ppt 1
Struts ppt 1
Struts ppt 1
Struts ppt 1
Struts ppt 1
Struts ppt 1

More Related Content

What's hot

Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) pptmrsurwar
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overviewskill-guru
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Applicationelliando dias
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
Struts & hibernate ppt
Struts & hibernate pptStruts & hibernate ppt
Struts & hibernate pptPankaj Patel
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts frameworks4al_com
 
Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 FrameworkEmprovise
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issuesPrashant Seth
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Courseguest764934
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questionsjbashask
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
Just a View: An Introduction To Model-View-Controller Pattern
Just a View:  An Introduction To Model-View-Controller PatternJust a View:  An Introduction To Model-View-Controller Pattern
Just a View: An Introduction To Model-View-Controller PatternAaron Nordyke
 

What's hot (20)

Struts introduction
Struts introductionStruts introduction
Struts introduction
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
 
Struts presentation
Struts presentationStruts presentation
Struts presentation
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Application
 
Struts course material
Struts course materialStruts course material
Struts course material
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Struts & hibernate ppt
Struts & hibernate pptStruts & hibernate ppt
Struts & hibernate ppt
 
Struts2
Struts2Struts2
Struts2
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 Framework
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
 
Struts2
Struts2Struts2
Struts2
 
Struts2
Struts2Struts2
Struts2
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Just a View: An Introduction To Model-View-Controller Pattern
Just a View:  An Introduction To Model-View-Controller PatternJust a View:  An Introduction To Model-View-Controller Pattern
Just a View: An Introduction To Model-View-Controller Pattern
 

Similar to Struts ppt 1

J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenlissa cidhi
 
Krazykoder struts2 intro
Krazykoder struts2 introKrazykoder struts2 intro
Krazykoder struts2 introKrazy Koder
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2Long Nguyen
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2divzi1913
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questionssurendray
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworksMukesh Kumar
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksSunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworksSunil Patil
 
Apachecon 2002 Struts
Apachecon 2002 StrutsApachecon 2002 Struts
Apachecon 2002 Strutsyesprakash
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2Santosh Singh Paliwal
 
Struts interview-questions-ppt
Struts interview-questions-pptStruts interview-questions-ppt
Struts interview-questions-pptMayank Kumar
 

Similar to Struts ppt 1 (20)

J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
MVC
MVCMVC
MVC
 
Krazykoder struts2 intro
Krazykoder struts2 introKrazykoder struts2 intro
Krazykoder struts2 intro
 
Struts Interceptors
Struts InterceptorsStruts Interceptors
Struts Interceptors
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
 
Skillwise Struts.x
Skillwise Struts.xSkillwise Struts.x
Skillwise Struts.x
 
Struts
StrutsStruts
Struts
 
Struts2.x
Struts2.xStruts2.x
Struts2.x
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
 
Ibm
IbmIbm
Ibm
 
141060753008 3715301
141060753008 3715301141060753008 3715301
141060753008 3715301
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
Apachecon 2002 Struts
Apachecon 2002 StrutsApachecon 2002 Struts
Apachecon 2002 Struts
 
Struts
StrutsStruts
Struts
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2
 
Struts interview-questions-ppt
Struts interview-questions-pptStruts interview-questions-ppt
Struts interview-questions-ppt
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 

Struts ppt 1

  • 1. Struts Ppt 1 - Presentation Transcript<br />STRUTS Jaya Prakash...<br />Struts Agenda<br />Software Crises<br />What is Framework<br />Model1,Model2<br />What is Struts<br />Why we need it<br />Why is it called as Struts<br />Advantages of Struts<br />Terminology of Struts<br />Architecture of Struts<br />Controller Elements & it’s Responsibilities<br />Model Elements & it’s Responsibilities<br />View Elements & it’s<br />Responsibilities<br />Struts sequence diagram<br />I18n<br />Disadvantages<br />Challenges Exist In Software Development & Software Crisis<br />Projects must be developed Quickly.<br />Projects must be in High-Quality.<br />Application Stability.<br />Better code Maintainability.<br />Lower Cost for Developing Application.<br />To solve above Challenges<br />The Software Development Community Introduced Frameworks to Guide Development.<br />* Time shown with out day light savings<br />What is Framework<br />A software framework is a re-usable design for a software system (or subsystem).<br />A framework is a pre-built assembly of components and is designed to be extended.<br />It is also base for components.<br />Advantages of Framework<br />Provide a procedure for the development of Application.<br />Saves developers Time.<br />Provides same approach for all developers for developing code and Consistency in Software Design<br />Provide low-level services that developers can use to speedup development.<br />It also reduces software development and maintenance costs.<br />Most of the frameworks follow Model1,Model2<br />Model 1<br />In the Model 1 the JSP page is responsible for processing the incoming request and replying back to the client.<br />Disadvantages of Model1<br />It does not have separate controller<br />This Architecture usually leads to a significant amount of Java code embedded within the JSP page<br />Model 1 architecture is suitable for applications that have very simple page flow, have little need for centralized and change little over time.<br />Developers Designers JSP<br />Developers and designers must work on the same files!<br />Model 2<br />This Model2 approach combines the use of both servlets and JSP, using JSP to generate the presentation layer and servlets to perform process-intensive tasks.<br />Model2 architecture introduces a Servlet between the browser and the JSP pages.<br />The servlet acts as the controller and is in charge of the request processing and the creation of any beans or objects used by the JSP, as well as deciding, depending on the user's actions, which JSP page to forward the request to.<br />Model2 Advantages<br />No processing/business logic within the JSP page.<br />Model 2 applications are easier to maintain and extend, because views do not refer to each other directly.<br />The Model 2 controller servlet provides a single point of control for security and often encapsulates incoming data into a form usable by the back-end MVC model.<br />It also Provides unique responsibility to each component and each is independent of the other component .<br />Change in one component will have no or less impact on other components.<br />Model 2 Components and Responsibilities<br />Model<br />The Model portion of an MVC-based System responsible for internal state of the system, and actions that can be taken to change that state<br />Decide “ How to do ”<br />Controller<br />-Decide “ What to do ”<br />-The Controller portion of the application is focused on receiving requests from the client ,deciding what business logic is to be performed ,and then delegating responsibility for producing the next phase of user interface to an appropriate View Component<br />View<br />Presentation<br />What is Struts<br />An open source web application framework based on j2ee and java which implements the MVC design pattern is called Struts.<br />Why is it called as Struts<br />Strut synonym is Iron-rod.<br />Why we use and what are the advantages of Struts<br />It is open source.<br />Provides components for building Web Applications that speedup development and saves time for developers.<br />It makes complex applications into simple.<br />Built in Exception Handling<br />I18n support with resource bundles.<br />Built in validation framework.<br />It also have tiles framework (A template mechanism incorporated into struts for managing page layouts.)<br />Struts Architecture<br />Struts Framework Components<br />Controller Components - Direct the Action<br />Model Components - Access Data and Systems<br />View Components - What the users see<br />Struts Controller Components<br />Struts-config.xml<br />Actionservlet and Requestprocessor<br />Receive the HttpServletRequest<br />Automatically populate a JavaBean from the request parameters.<br />Handle Locale Issues<br />Determine which Action to invoke based on URI<br />Extends javax.servlet.http.HttpServlet<br />Receives all framework requests<br />Selects proper application module<br />Delegates request handling to the RequestProcessor instance<br />One ActionServlet instance per web application<br />Default implementation provided by Framework<br />Actionservlet and Requestprocessor<br />ActionServlet dispatch request to Request Processor(New from 1.1. previous this behaviour was in Action servlet)<br />The work of Request Processor is:-<br />Finding ActionMapping.<br />Mapping Action to FormBean.<br />Creating FormBean Object.<br />Calling reset() method of FormBean<br />Calling Validator of FormBean<br />If no form(jsp/html) validation errors calls execute method in Action Class and finding response to request.<br />If Errors give the errors on jsp present in input attribute of Action tag in struts-config.xml.<br />What is An Action Class<br />Extends org.apache.struts.action.Action<br />Overrides the execute() method<br />Acts as a bridge between user-invoked URI and a business method<br />Return information about which view should be rendered next<br />Part of the Controller ,not the Model<br />Actionclass Example<br />Struts-Config.xml<br />The power and flexibility of struts is due to the extracting of configuration information from across frame work.<br />Configuration file contains action mappings (determines navigation)<br />Controller uses mappings to turn HTTP requests into application actions<br />Mapping must specify<br />A request path<br />Object type to act upon the request<br />Tags in this file are:-<br />Data Sources.<br />Form Beans.<br />Global Exceptions.<br />Global Forwards<br />Actions<br />Controller<br />Message resources<br />Plug-in<br />Struts- Config.xml Example<br />The Model Components<br />Model Components<br />Java classes<br />middle tier components (EJB, Javabeans, …)<br />database access components<br />Used to represent the Internal state of the system<br />Actions that can change that state<br />Internal state of system represented by<br />JavaBeans<br />Enterprise JavaBeans<br />Action Form<br />Extends the ActionForm class<br />Create one for each input form in the application<br />It is just like a java bean, Store data temporary, reset default values to views, validate input view.<br />Hold state and behavior for user input.<br />If defined in the ActionMapping configuration file, the Controller Servlet will perform the following:-<br />Check for instance of bean of appropriate class<br />If no bean exists, one is created automatically<br />For every request parameter whose name corresponds to the name of a property in the bean, the corresponding setter method will be called<br />The updated ActionForm bean will be passed to the Action Class execute () method when it is called, making these values immediately available.<br />ActionForm Example<br />The View Components<br />Struts JSP Tag Libraries<br />HTML<br />Bean<br />Logic<br />Nested<br />Tiles<br />Template<br />Html Tag & Bean Tag Libraries<br />Tags used to create Struts input forms<br />Examples (checkbox,image,<br />link, submit ,text, text area)<br />Tags used for accessing JavaBeans and their properties<br />Examples (Define,message,write)<br />Logic ,Tiles & Nested Tag Libraries<br />Managing conditional generation of output text<br />Looping over object Collections for repetitive generation of output text<br />Example (empty,lessThan,<br />greaterThan)<br />Extended the base struts tags to allow them to relate to each other in nested nature<br />Tiles tags<br />Each part (&quot;Tile&quot;) of webpage can be reused as often as needed throughout your application. This reduces the amount of markup that needs to be maintained and makes it easier to change the look and feel of a website.<br />Template Tag Library<br />The &quot;struts-template&quot; tag library contains tags that are useful in creating dynamic JSP templates for pages which share a common format. These templates are best used when it is likely that a layout shared by several pages in your application will change. The functionality provided by these tags is similar to what can be achieved using standard JSP include directive , but are dynamic rather than static.<br />Note: As of Struts 1.1 the template library has been deprecated<br />Action Message & Action Error<br />Used to signify general purpose informational and error messages<br />Rely on the resource bundles<br />JSP Tags can access them<br /></html:errors><br />Internationalization Support<br />Much of the framework functionality based on java.util.Locale<br />Struts Uses Java Resource Bundles .<br />Ex:-<br />Date ,Time and Currency Formatting<br />Currency Conversion<br />Resource Bundle Example<br />Other Features Suported by Struts Framework<br />Multi-Module Support<br />Declarative Exception-Handling<br />Dynamic Action Forms<br />Plugins<br />Tiles integrated With Core<br />Validator Integrated With Core<br />Struts Sequence Diagram<br />Struts Example<br />0.167.192.116login_app<br />Webapps|<br />|sample(Application Name)<br />|__ login.jsp<br />|__newLogin.Jsp<br />|__success.jsp<br />|__WEB-INF<br />|__web.xml<br />|__Struts-config.xml<br /> All the struts tld files|__*.tld <br />|__lib<br /> All the jar files|__*.jar <br />|__classes<br />|__LoginAction,LoginForm,<br />Messageresorces<br />Disadvantages<br />Bigger Learning Curve<br />Not Based on Domain Model<br />Property Names<br />Views are restricted .<br />Questions & Answers QUESTIONS & ANSWERS What did I Miss?<br />Thank u mail me:-jayaprakash.m.java@gmail.com<br />