SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

Struts introduction
Struts introductionStruts introduction
Struts introduction
Muthukumaran Subramanian
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
mrsurwar
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
skill-guru
 
Struts presentation
Struts presentationStruts presentation
Struts presentation
Nicolaescu Petru
 
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
elliando dias
 
Struts course material
Struts course materialStruts course material
Struts course material
Vibrant Technologies & Computers
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Struts & hibernate ppt
Struts & hibernate pptStruts & hibernate ppt
Struts & hibernate ppt
Pankaj Patel
 
Struts2
Struts2Struts2
Struts2
Rajiv Gupta
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
s4al_com
 
Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 Framework
Emprovise
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
Prashant Seth
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
guest764934
 
Struts2
Struts2Struts2
Struts2
shankar_b7
 
Struts2
Struts2Struts2
Struts2
Scott Stanlick
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
jbashask
 
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
Tuna Tore
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
Lokesh 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 Pattern
Aaron Nordyke
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
mrsurwar
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
skill-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 Application
elliando dias
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Struts & hibernate ppt
Struts & hibernate pptStruts & hibernate ppt
Struts & hibernate ppt
Pankaj Patel
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
s4al_com
 
Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 Framework
Emprovise
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
Prashant Seth
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
guest764934
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
jbashask
 
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
Tuna 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 Pattern
Aaron Nordyke
 

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
lissa cidhi
 
MVC
MVCMVC
MVC
akshin
 
Krazykoder struts2 intro
Krazykoder struts2 introKrazykoder struts2 intro
Krazykoder struts2 intro
Krazy Koder
 
struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
Struts Interceptors
Struts InterceptorsStruts Interceptors
Struts Interceptors
Onkar Deshpande
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
patinijava
 
Skillwise Struts.x
Skillwise Struts.xSkillwise Struts.x
Skillwise Struts.x
Skillwise Group
 
Struts
StrutsStruts
Struts
Ranjan Kumar
 
Struts2.x
Struts2.xStruts2.x
Struts2.x
Sandeep Rawat
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
Long Nguyen
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
divzi1913
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
surendray
 
Ibm
IbmIbm
Ibm
techbed
 
141060753008 3715301
141060753008 3715301141060753008 3715301
141060753008 3715301
ITM Universe - Vadodara
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
Mukesh 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 frameworks
Sunil 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 Frameworks
Sunil Patil
 
Apachecon 2002 Struts
Apachecon 2002 StrutsApachecon 2002 Struts
Apachecon 2002 Struts
yesprakash
 
Struts
StrutsStruts
Struts
Rajkumar Singh
 
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
lissa cidhi
 
Krazykoder struts2 intro
Krazykoder struts2 introKrazykoder struts2 intro
Krazykoder struts2 intro
Krazy Koder
 
struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
Long Nguyen
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
divzi1913
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
surendray
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
Mukesh 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 frameworks
Sunil 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 Frameworks
Sunil Patil
 
Apachecon 2002 Struts
Apachecon 2002 StrutsApachecon 2002 Struts
Apachecon 2002 Struts
yesprakash
 
Ad

Recently uploaded (20)

YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Ad

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:[email protected]<br />