SlideShare a Scribd company logo
Introduction to
Jakarta Struts
Framework
The Evolution of Server Side
Web Ap Developement
 CGI(or ISAPI)
 Servlet
 JSP
 JSP+Bean (Model 1)
 JSP+Bean+XML techs
 Model 2 (MVC)
 Model 2X(MVC with XML techs)
What is MVC
 The Model View Controller is a technique used to separate
Business logic/state (the Model) from User Interface (the
View) and program progression/flow (the Control).
 This pattern is very useful when it comes to modern web
development:
– The majority of modern, high usage websites are
dynamically driven.
– People well skilled at presentation (HTML writers) seldom
know how to develop back-end solutions and visa versa.
– Separating business rules from presentation is good no
matter what environment you develop in be it web or
desktop.
資料來源 Craig W. Tataryn ,Introduction to MVC and the Jakarta Struts Framework
Benefits of MVC
 Promotes Modularity
 I18n
 Abstraction
 Allows application to be defined in a
flow-chart, use-case or activity
diagram which is more easily
transferred to implementation.
資料來源 Craig W. Tataryn ,Introduction to MVC and the Jakarta Struts Framework
The Struts Framework
overview
 Struts is an open source MVC framework developed by the
Apache Jakarta project group.
 Struts allows JSP/Servlet writers the ability to fashion their
web applications using the MVC design pattern.
 By designing your web application using Struts you allow:
– Architect the ability to design using the MVC pattern
– Developer to exploit the Struts framework when building
the app.
– Web designer can learn how to program in MVC.
資料來源 http://jakarta.apache.org/struts/
The Struts Framework
overview(2)
 Struts takes much difficult work out of
developing an MVC based web app.
 The Struts framework provides a collection
of canned objects which can facilitate
fundamental aspects of MVC, while allowing
you to extend further as need suites
Components of Struts
Framework
 Model
– Business Logic Bean(or session
bean) 、 StateBean(or entity
bean) 、 ActionForm 。
 View
– A Set of Tag library.
– Language Resource File
 Controller
– ActionServlet( controlled by struct-configs.xml)
– ActionClasses
 Utility Classes
Components of Struts
Framework(2)
資料來源 http://www-106.ibm.com/developerworks/library/j-struts/?n-j-2151
How Struts works
資料來源 http://www-106.ibm.com/developerworks/library/j-struts/?n-j-2151
View
 The view in Struts is represented by
JSP pages.
 Minimize the occurance of scriptlets in
your page
–Use the tag-library provided by
Struts to control the presenatational
logic.
View:I18n
 The ability to maintain a web app in several
different languages
 Based on the language setup on the client
side, the web app will automatically switch.
 This is achieve in Struts through Java
Resource Bundles
 Instead of having to make a
ResourceBundle class for each language
supported by your web app, resource
bundles can be described as language
resource files
Traditional Chinese English
Demo
View:I18n(2)
 Language Resource
– FileName Conventions
(ResourceName)_(ISO-LanguageCode)_(ISO-ConturyCode).properties
– Register the Resource Name in web.xml.
 In order for web developers to get at
the string resources we use a special
Struts tag called <bean:message/>
View:Example
 Login.jsp
 ApplicationResources_en_US.properti
es
 ApplicationResources_zh_TW.properti
es
Model
 ResultBean,hold information needed
to generate the result page.
 FromBean(extend ActionForm ),hold
the data passed by user either by
POST or Query String.
 Business Logic Bean.
 EJB 、 JMS or other components we
impl at business logic layer before.
Model:ActionForm
 JSP pages acting as the view for this
LogonForm are automatically updated by
Struts with the current values of the
UserName and Password properties.
 If the user changes the properties via the
JSP page, the LogonForm will automatically
be updated by Struts
 Before an ActionForm object is passed to a
controller for processing, a “validate”
method can be implemented on the form
which allows the form to belay processing
until the user fixes invalid input
Model:Example
 LoginForm.java
 tw.edu.nccu.user.TeacherData
Control
 The controller is the switch board of MVC.
 It directs the user to the appropriate views by providing the
view with the correct model
 The task of directing users to appropriate views is called
“mapping” in struts.
 The Struts framework provides a base object called
org.apache.struts.action.ActionServlet.
 The ActionServlet class uses a configuration file called
struts-config.xml to read mapping data called action
mappings
 The ActionServlet class reads the incoming URI and tries to
match the URI against a set of action mappings to see if it can
find a controller class which would be willing to handle the
request
http://TeacherStudata/login.action
Server configured to pass *.action extensions to
org.apache.struts.action.ActionServlet
via a web.xml configuration file
ActionServlet object inspects the URI and tries to match it
against an ActionMapping located in the struts-config.xml file.
Instance of appropriate Action class is found and it’s perform() method is called
Action object handles the request and returns control to a view based where the user is within
the flow of the application
Controller (2)
Control:Example
 tw.edu.nccu.teacherstudata.actions.Lo
ginAction
 Struts-config.xml
 LoginAction.java
Problems with Struts
 Does not work on JDK1.4.0
 Steep learning curve.
 Problems on old Application Servers(include
Tomcat3.2.1 、 Weblogic 5.1).
 The only output document is HTML , it
didn’t support the XSL transform
technology.(Unless we modify the source
code)
Model 2X
 Model2X
– Conceived by Julien Mercay and Gilbert
Bouzeid on Feb 1,2002.
– Replace the JSP+TagLib with XML+XSLT
at presentation layer.
– Using XSL Servlet as the Document
Factory.
– Support pipe-line processing while
generating the target document.
Resource
 Struts homepage
– http://jakarta.apache.org/struts/
 Sun’s Servlet Specification
– http://java.sun.com/products/servlet/download.ht
ml#specs
 Sun’s JSP Specification
– http://java.sun.com/products/jsp/download.html
 Blue Stone’s Struts Tutorial
– http://developer.bluestone.com/scripts/SaISAPI.
dll/Gallery.class/demos/trailMaps/index.jsp
 My Struts page
– http://java.cc.nccu.edu.tw/struts/

More Related Content

What's hot

Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
Aneega
 
Struts introduction
Struts introductionStruts introduction
Struts introduction
Muthukumaran Subramanian
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
Return on Intelligence
 
Angular 8
Angular 8 Angular 8
Angular 8
Sunil OS
 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
CPD INDIA
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
Prem Sanil
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
DrSonali Vyas
 
Java Collections
Java  Collections Java  Collections
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
Mehul Jariwala
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
BG Java EE Course
 
Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
Ashish Gupta
 
Introduction to struts
Introduction to strutsIntroduction to struts
Introduction to struts
Mindfire Solutions
 
Servlets
ServletsServlets
Servlets
ZainabNoorGul
 
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
Edureka!
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin Shah
 
Java RMI
Java RMIJava RMI
Java RMI
Prajakta Nimje
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation洪 鹏发
 
Java Collections Framework
Java Collections FrameworkJava Collections Framework
Java Collections Framework
Sony India Software Center
 
Wrapper class
Wrapper classWrapper class
Wrapper class
kamal kotecha
 

What's hot (20)

Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Struts introduction
Struts introductionStruts introduction
Struts introduction
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Java Collections
Java  Collections Java  Collections
Java Collections
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
 
Introduction to struts
Introduction to strutsIntroduction to struts
Introduction to struts
 
Servlets
ServletsServlets
Servlets
 
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Java RMI
Java RMIJava RMI
Java RMI
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Java Collections Framework
Java Collections FrameworkJava Collections Framework
Java Collections Framework
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 

Viewers also liked

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
 
Jsp & struts
Jsp & strutsJsp & struts
Jsp & struts
Hansi Thenuwara
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
Matt Raible
 
Struts presentation
Struts presentationStruts presentation
Struts presentation
Nicolaescu Petru
 
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Teerasej Jiraphatchandej
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
NexThoughts Technologies
 
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้นเรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
Teerasej Jiraphatchandej
 

Viewers also liked (8)

Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
Jsp & struts
Jsp & strutsJsp & struts
Jsp & struts
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Struts presentation
Struts presentationStruts presentation
Struts presentation
 
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้นเรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
 

Similar to Struts

Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
pavanteja86
 
Skillwise Struts.x
Skillwise Struts.xSkillwise Struts.x
Skillwise Struts.x
Skillwise Group
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
jbashask
 
Struts2.x
Struts2.xStruts2.x
Struts2.x
Sandeep Rawat
 
Apachecon 2002 Struts
Apachecon 2002 StrutsApachecon 2002 Struts
Apachecon 2002 Strutsyesprakash
 
Struts 1
Struts 1Struts 1
Struts 1
Lalit Garg
 
Krazykoder struts2 intro
Krazykoder struts2 introKrazykoder struts2 intro
Krazykoder struts2 introKrazy Koder
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questionssurendray
 
Struts course material
Struts course materialStruts course material
Struts course material
Vibrant Technologies & Computers
 
141060753008 3715301
141060753008 3715301141060753008 3715301
141060753008 3715301
ITM Universe - Vadodara
 
Struts
StrutsStruts
Struts Interceptors
Struts InterceptorsStruts Interceptors
Struts Interceptors
Onkar Deshpande
 
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
Beat Signer
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
mrsurwar
 

Similar to Struts (20)

Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
 
Skillwise Struts.x
Skillwise Struts.xSkillwise Struts.x
Skillwise Struts.x
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
 
Struts2.x
Struts2.xStruts2.x
Struts2.x
 
Apachecon 2002 Struts
Apachecon 2002 StrutsApachecon 2002 Struts
Apachecon 2002 Struts
 
MVC
MVCMVC
MVC
 
Struts 1
Struts 1Struts 1
Struts 1
 
Struts
StrutsStruts
Struts
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
 
Lecture 05 web_applicationframeworks
Lecture 05 web_applicationframeworksLecture 05 web_applicationframeworks
Lecture 05 web_applicationframeworks
 
Krazykoder struts2 intro
Krazykoder struts2 introKrazykoder struts2 intro
Krazykoder struts2 intro
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
 
Struts course material
Struts course materialStruts course material
Struts course material
 
141060753008 3715301
141060753008 3715301141060753008 3715301
141060753008 3715301
 
Struts
StrutsStruts
Struts
 
Struts
StrutsStruts
Struts
 
Struts Interceptors
Struts InterceptorsStruts Interceptors
Struts Interceptors
 
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
 
Struts2
Struts2Struts2
Struts2
 

More from s4al_com

Webservices
WebservicesWebservices
Webservices
s4al_com
 
Spring talk111204
Spring talk111204Spring talk111204
Spring talk111204
s4al_com
 
Spring
SpringSpring
Spring
s4al_com
 
Orm and hibernate
Orm and hibernateOrm and hibernate
Orm and hibernate
s4al_com
 
Java
JavaJava
Java
s4al_com
 
Online gas booking project in java
Online gas booking project in javaOnline gas booking project in java
Online gas booking project in java
s4al_com
 

More from s4al_com (6)

Webservices
WebservicesWebservices
Webservices
 
Spring talk111204
Spring talk111204Spring talk111204
Spring talk111204
 
Spring
SpringSpring
Spring
 
Orm and hibernate
Orm and hibernateOrm and hibernate
Orm and hibernate
 
Java
JavaJava
Java
 
Online gas booking project in java
Online gas booking project in javaOnline gas booking project in java
Online gas booking project in java
 

Recently uploaded

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Struts

  • 2. The Evolution of Server Side Web Ap Developement  CGI(or ISAPI)  Servlet  JSP  JSP+Bean (Model 1)  JSP+Bean+XML techs  Model 2 (MVC)  Model 2X(MVC with XML techs)
  • 3. What is MVC  The Model View Controller is a technique used to separate Business logic/state (the Model) from User Interface (the View) and program progression/flow (the Control).  This pattern is very useful when it comes to modern web development: – The majority of modern, high usage websites are dynamically driven. – People well skilled at presentation (HTML writers) seldom know how to develop back-end solutions and visa versa. – Separating business rules from presentation is good no matter what environment you develop in be it web or desktop. 資料來源 Craig W. Tataryn ,Introduction to MVC and the Jakarta Struts Framework
  • 4.
  • 5. Benefits of MVC  Promotes Modularity  I18n  Abstraction  Allows application to be defined in a flow-chart, use-case or activity diagram which is more easily transferred to implementation. 資料來源 Craig W. Tataryn ,Introduction to MVC and the Jakarta Struts Framework
  • 6. The Struts Framework overview  Struts is an open source MVC framework developed by the Apache Jakarta project group.  Struts allows JSP/Servlet writers the ability to fashion their web applications using the MVC design pattern.  By designing your web application using Struts you allow: – Architect the ability to design using the MVC pattern – Developer to exploit the Struts framework when building the app. – Web designer can learn how to program in MVC. 資料來源 http://jakarta.apache.org/struts/
  • 7. The Struts Framework overview(2)  Struts takes much difficult work out of developing an MVC based web app.  The Struts framework provides a collection of canned objects which can facilitate fundamental aspects of MVC, while allowing you to extend further as need suites
  • 8. Components of Struts Framework  Model – Business Logic Bean(or session bean) 、 StateBean(or entity bean) 、 ActionForm 。  View – A Set of Tag library. – Language Resource File  Controller – ActionServlet( controlled by struct-configs.xml) – ActionClasses  Utility Classes
  • 9. Components of Struts Framework(2) 資料來源 http://www-106.ibm.com/developerworks/library/j-struts/?n-j-2151
  • 10. How Struts works 資料來源 http://www-106.ibm.com/developerworks/library/j-struts/?n-j-2151
  • 11. View  The view in Struts is represented by JSP pages.  Minimize the occurance of scriptlets in your page –Use the tag-library provided by Struts to control the presenatational logic.
  • 12. View:I18n  The ability to maintain a web app in several different languages  Based on the language setup on the client side, the web app will automatically switch.  This is achieve in Struts through Java Resource Bundles  Instead of having to make a ResourceBundle class for each language supported by your web app, resource bundles can be described as language resource files
  • 14. View:I18n(2)  Language Resource – FileName Conventions (ResourceName)_(ISO-LanguageCode)_(ISO-ConturyCode).properties – Register the Resource Name in web.xml.  In order for web developers to get at the string resources we use a special Struts tag called <bean:message/>
  • 16. Model  ResultBean,hold information needed to generate the result page.  FromBean(extend ActionForm ),hold the data passed by user either by POST or Query String.  Business Logic Bean.  EJB 、 JMS or other components we impl at business logic layer before.
  • 17. Model:ActionForm  JSP pages acting as the view for this LogonForm are automatically updated by Struts with the current values of the UserName and Password properties.  If the user changes the properties via the JSP page, the LogonForm will automatically be updated by Struts  Before an ActionForm object is passed to a controller for processing, a “validate” method can be implemented on the form which allows the form to belay processing until the user fixes invalid input
  • 19. Control  The controller is the switch board of MVC.  It directs the user to the appropriate views by providing the view with the correct model  The task of directing users to appropriate views is called “mapping” in struts.  The Struts framework provides a base object called org.apache.struts.action.ActionServlet.  The ActionServlet class uses a configuration file called struts-config.xml to read mapping data called action mappings  The ActionServlet class reads the incoming URI and tries to match the URI against a set of action mappings to see if it can find a controller class which would be willing to handle the request
  • 20. http://TeacherStudata/login.action Server configured to pass *.action extensions to org.apache.struts.action.ActionServlet via a web.xml configuration file ActionServlet object inspects the URI and tries to match it against an ActionMapping located in the struts-config.xml file. Instance of appropriate Action class is found and it’s perform() method is called Action object handles the request and returns control to a view based where the user is within the flow of the application Controller (2)
  • 22. Problems with Struts  Does not work on JDK1.4.0  Steep learning curve.  Problems on old Application Servers(include Tomcat3.2.1 、 Weblogic 5.1).  The only output document is HTML , it didn’t support the XSL transform technology.(Unless we modify the source code)
  • 23. Model 2X  Model2X – Conceived by Julien Mercay and Gilbert Bouzeid on Feb 1,2002. – Replace the JSP+TagLib with XML+XSLT at presentation layer. – Using XSL Servlet as the Document Factory. – Support pipe-line processing while generating the target document.
  • 24.
  • 25.
  • 26. Resource  Struts homepage – http://jakarta.apache.org/struts/  Sun’s Servlet Specification – http://java.sun.com/products/servlet/download.ht ml#specs  Sun’s JSP Specification – http://java.sun.com/products/jsp/download.html  Blue Stone’s Struts Tutorial – http://developer.bluestone.com/scripts/SaISAPI. dll/Gallery.class/demos/trailMaps/index.jsp  My Struts page – http://java.cc.nccu.edu.tw/struts/