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
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servletdasguptahirak
 
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
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6Lokesh Singrol
 
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
 
MVC
MVCMVC
MVCakshin
 
Krazykoder struts2 intro
Krazykoder struts2 introKrazykoder struts2 intro
Krazykoder struts2 introKrazy Koder
 
Struts Interceptors
Struts InterceptorsStruts Interceptors
Struts InterceptorsOnkar Deshpande
 
Struts N E W
Struts N E WStruts N E W
Struts N E Wpatinijava
 
Skillwise Struts.x
Skillwise Struts.xSkillwise Struts.x
Skillwise Struts.xSkillwise Group
 
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
 
Ibm
IbmIbm
Ibmtechbed
 
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

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 

Recently uploaded (20)

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 

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 />