SlideShare a Scribd company logo
1 of 46
Struts 2.0 Don Brown
Web, Circa 2000
Web, Circa 2006
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Struts 2 Architecture
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Struts Plugins
Simple Example
Struts 1 < html:errors /> < html:form  action = &quot;/SaveMeeting&quot; > < table  border = &quot;0&quot;  width = &quot;100%&quot; > < tr > < th  align = &quot;right&quot; > Name: </ th > < td  align = &quot;left&quot; > < html:text  property = &quot;name&quot;  size = ”50”  /> </ td > </ tr > < tr > < th  align = &quot;right&quot; > Date:
</ th > < td  align = &quot;left&quot; > < html:text  property = &quot;date&quot;  size = &quot;50&quot; /> </ td > </ tr > < tr > < th  align = &quot;right&quot; > Invitees: </ th > < td  align = &quot;left&quot; > < html:select  property = &quot;invitees&quot; multiple = &quot;true&quot; > < html:options  collection = &quot;employees&quot;  property = &quot;value&quot; labelProperty = &quot;label&quot; /> </ html:select >
</ tr > < tr > < th  align = &quot;right&quot; > Description: </ th > < td  align = &quot;left&quot; > < html:textarea  property = &quot;description&quot; rows = &quot;4&quot;  cols = &quot;50&quot;  /> </ td > </ tr > < tr > < td  align = &quot;right&quot; > &nbsp; </ td >
... Only four pages! < td  align = &quot;left&quot; > < html:submit  property = &quot;DO_SUBMIT&quot; > Save </ html:submit > </ td > </ tr > </ table > </ html:form >
Struts 2 < s:form  action = &quot;Meeting&quot;  validate = &quot;true&quot; > < s:token  /> < s:textfield  label = ”Name”  name = “name” /> < s:textfield   label = ”Date&quot;   name = &quot;date&quot; /> < s:select  label = ”Invitees”  name = &quot;invitees&quot;   list = &quot;employees&quot; /> < s:textarea   label = ”Description” n ame = &quot;description&quot;   rows = &quot;4&quot;   cols = &quot;50&quot;   /> < s:submit   value = ”Save&quot;   method = &quot;save&quot; /> </ s:form >
Example Revisited
<s:textfield label=&quot;Name&quot; name=&quot;name&quot;   tooltip = &quot;Meeting name&quot;   />
< s:datepicker   label=&quot;Date&quot; name=&quot;date&quot;/>
< s:optiontransferselect  ...  />
< jsp:include  page = &quot;/ajax/commonInclude.jsp&quot; /> ... <s:textarea   theme = &quot;ajax&quot;   label=&quot;Description&quot;  name=&quot;description&quot; rows=&quot;4&quot; cols=&quot;50&quot; />
But there's more . . .
Brian Kernighan Law of Debugging Difficulty Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Prevention and Cure
struts.devMode = true
 
 
Built-in Testing Support public class MyActionTest extends StrutsTestCase { public void testExecute() throws Exception { assertTrue(true); } }
any.action?debug=console
any.action?profiling=yes
Time to Upgrade?
Tutorials, Guides, and FAQs
Struts 2 Training Course
< action  name = &quot;editGangster&quot;  class = &quot;org.apache.struts2.s1.Struts1Action&quot; > < param  name = &quot;className&quot; > com.mycompany.gangstas.EditGangsterAction </ param > < result > gangsterForm.jsp </ result > </ action > Run Struts 1 Actions as Is
How do I get started?
Where We are Going

More Related Content

What's hot

Yeni Metin Belgesi (3)
Yeni Metin Belgesi (3)Yeni Metin Belgesi (3)
Yeni Metin Belgesi (3)
guest95153c
 

What's hot (17)

Quick Referance to WML
Quick Referance to WMLQuick Referance to WML
Quick Referance to WML
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAX
 
The Basics of (X)HTML Tags
The Basics of (X)HTML TagsThe Basics of (X)HTML Tags
The Basics of (X)HTML Tags
 
LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3
 
New HTML5/CSS3 techniques
New HTML5/CSS3 techniquesNew HTML5/CSS3 techniques
New HTML5/CSS3 techniques
 
Lecture 2 - Comm Lab: Web @ ITP
Lecture 2 - Comm Lab: Web @ ITPLecture 2 - Comm Lab: Web @ ITP
Lecture 2 - Comm Lab: Web @ ITP
 
Class4
Class4Class4
Class4
 
Yeni Metin Belgesi (3)
Yeni Metin Belgesi (3)Yeni Metin Belgesi (3)
Yeni Metin Belgesi (3)
 
Front End on Rails
Front End on RailsFront End on Rails
Front End on Rails
 
Html
HtmlHtml
Html
 
Intro to Html 5
Intro to Html 5Intro to Html 5
Intro to Html 5
 
Using Forms in Share
Using Forms in ShareUsing Forms in Share
Using Forms in Share
 
Html
HtmlHtml
Html
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
Html 101
Html 101Html 101
Html 101
 
XHTML basics
XHTML basicsXHTML basics
XHTML basics
 

Viewers also liked

Viewers also liked (9)

Ye Ying(1)
Ye Ying(1)Ye Ying(1)
Ye Ying(1)
 
El Mal existe ?
El Mal existe ?El Mal existe ?
El Mal existe ?
 
El Tren De La Vida
El Tren De La Vida El Tren De La Vida
El Tren De La Vida
 
Ajax
AjaxAjax
Ajax
 
Semillas
Semillas Semillas
Semillas
 
Workshop Sutdio3(1)
Workshop Sutdio3(1)Workshop Sutdio3(1)
Workshop Sutdio3(1)
 
Com Fer Una Entrada al blog
Com Fer Una Entrada al blogCom Fer Una Entrada al blog
Com Fer Una Entrada al blog
 
Heckscheiben
HeckscheibenHeckscheiben
Heckscheiben
 
Regeln
RegelnRegeln
Regeln
 

Similar to We9 Struts 2.0

Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
Doncho Minkov
 
XML processing with perl
XML processing with perlXML processing with perl
XML processing with perl
Joe Jiang
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
vikasgaur31
 

Similar to We9 Struts 2.0 (20)

KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7
 
JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
 
Html tutorial
Html tutorialHtml tutorial
Html tutorial
 
Widgets Tools Keynote
Widgets Tools KeynoteWidgets Tools Keynote
Widgets Tools Keynote
 
Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
Lecture1 B Frames&Forms
Lecture1 B  Frames&FormsLecture1 B  Frames&Forms
Lecture1 B Frames&Forms
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
Html tags
Html tagsHtml tags
Html tags
 
Forum Presentation
Forum PresentationForum Presentation
Forum Presentation
 
XML processing with perl
XML processing with perlXML processing with perl
XML processing with perl
 
HTML5 Web Forms
HTML5 Web FormsHTML5 Web Forms
HTML5 Web Forms
 
Microsoft ASP.NET 4.0 : What's Next?
Microsoft ASP.NET 4.0 : What's Next?Microsoft ASP.NET 4.0 : What's Next?
Microsoft ASP.NET 4.0 : What's Next?
 
Java Script
Java ScriptJava Script
Java Script
 
Lecture3
Lecture3Lecture3
Lecture3
 
Lect_html1
Lect_html1Lect_html1
Lect_html1
 
Form Validation
Form ValidationForm Validation
Form Validation
 
HTML & CSS
HTML & CSSHTML & CSS
HTML & CSS
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 

More from wangjiaz

Zhanbin Web2.0
Zhanbin Web2.0Zhanbin Web2.0
Zhanbin Web2.0
wangjiaz
 
U Co M Protocol
U Co M ProtocolU Co M Protocol
U Co M Protocol
wangjiaz
 
Tt Seminar Taipei 9605(1)
Tt Seminar Taipei 9605(1)Tt Seminar Taipei 9605(1)
Tt Seminar Taipei 9605(1)
wangjiaz
 
The New Iphone
The New IphoneThe New Iphone
The New Iphone
wangjiaz
 
Struts Mitac(1)
Struts Mitac(1)Struts Mitac(1)
Struts Mitac(1)
wangjiaz
 
Sxdylgn(1)
Sxdylgn(1)Sxdylgn(1)
Sxdylgn(1)
wangjiaz
 
Struts Intro Course(1)
Struts Intro Course(1)Struts Intro Course(1)
Struts Intro Course(1)
wangjiaz
 
S11flash(1)
S11flash(1)S11flash(1)
S11flash(1)
wangjiaz
 
Role Play Exercises
Role Play ExercisesRole Play Exercises
Role Play Exercises
wangjiaz
 
Recruit(1)
Recruit(1)Recruit(1)
Recruit(1)
wangjiaz
 
web 2.0 class notes
web 2.0 class notesweb 2.0 class notes
web 2.0 class notes
wangjiaz
 
Ye Ying(1)
Ye Ying(1)Ye Ying(1)
Ye Ying(1)
wangjiaz
 
Xzzx20060302 1
Xzzx20060302 1Xzzx20060302 1
Xzzx20060302 1
wangjiaz
 
Flashch2(1)
Flashch2(1)Flashch2(1)
Flashch2(1)
wangjiaz
 

More from wangjiaz (20)

Zhanbin Web2.0
Zhanbin Web2.0Zhanbin Web2.0
Zhanbin Web2.0
 
U Co M Protocol
U Co M ProtocolU Co M Protocol
U Co M Protocol
 
Tt Seminar Taipei 9605(1)
Tt Seminar Taipei 9605(1)Tt Seminar Taipei 9605(1)
Tt Seminar Taipei 9605(1)
 
The New Iphone
The New IphoneThe New Iphone
The New Iphone
 
Struts Mitac(1)
Struts Mitac(1)Struts Mitac(1)
Struts Mitac(1)
 
Sxdylgn(1)
Sxdylgn(1)Sxdylgn(1)
Sxdylgn(1)
 
Struts Intro Course(1)
Struts Intro Course(1)Struts Intro Course(1)
Struts Intro Course(1)
 
Sjjz6(1)
Sjjz6(1)Sjjz6(1)
Sjjz6(1)
 
Sjjz5(1)
Sjjz5(1)Sjjz5(1)
Sjjz5(1)
 
S11flash(1)
S11flash(1)S11flash(1)
S11flash(1)
 
Role Play Exercises
Role Play ExercisesRole Play Exercises
Role Play Exercises
 
Recruit(1)
Recruit(1)Recruit(1)
Recruit(1)
 
114
114114
114
 
web 2.0 class notes
web 2.0 class notesweb 2.0 class notes
web 2.0 class notes
 
Yxch
YxchYxch
Yxch
 
Ye Ying(1)
Ye Ying(1)Ye Ying(1)
Ye Ying(1)
 
Xzzx20060302 1
Xzzx20060302 1Xzzx20060302 1
Xzzx20060302 1
 
Xcz
XczXcz
Xcz
 
Kj Chap01
Kj Chap01Kj Chap01
Kj Chap01
 
Flashch2(1)
Flashch2(1)Flashch2(1)
Flashch2(1)
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

We9 Struts 2.0

  • 4.  
  • 5.  
  • 6.  
  • 7.  
  • 8.  
  • 9.  
  • 10.  
  • 11.  
  • 12.  
  • 13.  
  • 14.  
  • 15.  
  • 16.  
  • 17.  
  • 19.
  • 22. Struts 1 < html:errors /> < html:form action = &quot;/SaveMeeting&quot; > < table border = &quot;0&quot; width = &quot;100%&quot; > < tr > < th align = &quot;right&quot; > Name: </ th > < td align = &quot;left&quot; > < html:text property = &quot;name&quot; size = ”50” /> </ td > </ tr > < tr > < th align = &quot;right&quot; > Date:
  • 23. </ th > < td align = &quot;left&quot; > < html:text property = &quot;date&quot; size = &quot;50&quot; /> </ td > </ tr > < tr > < th align = &quot;right&quot; > Invitees: </ th > < td align = &quot;left&quot; > < html:select property = &quot;invitees&quot; multiple = &quot;true&quot; > < html:options collection = &quot;employees&quot; property = &quot;value&quot; labelProperty = &quot;label&quot; /> </ html:select >
  • 24. </ tr > < tr > < th align = &quot;right&quot; > Description: </ th > < td align = &quot;left&quot; > < html:textarea property = &quot;description&quot; rows = &quot;4&quot; cols = &quot;50&quot; /> </ td > </ tr > < tr > < td align = &quot;right&quot; > &nbsp; </ td >
  • 25. ... Only four pages! < td align = &quot;left&quot; > < html:submit property = &quot;DO_SUBMIT&quot; > Save </ html:submit > </ td > </ tr > </ table > </ html:form >
  • 26. Struts 2 < s:form action = &quot;Meeting&quot; validate = &quot;true&quot; > < s:token /> < s:textfield label = ”Name” name = “name” /> < s:textfield label = ”Date&quot; name = &quot;date&quot; /> < s:select label = ”Invitees” name = &quot;invitees&quot; list = &quot;employees&quot; /> < s:textarea label = ”Description” n ame = &quot;description&quot; rows = &quot;4&quot; cols = &quot;50&quot; /> < s:submit value = ”Save&quot; method = &quot;save&quot; /> </ s:form >
  • 28. <s:textfield label=&quot;Name&quot; name=&quot;name&quot; tooltip = &quot;Meeting name&quot; />
  • 29. < s:datepicker label=&quot;Date&quot; name=&quot;date&quot;/>
  • 31. < jsp:include page = &quot;/ajax/commonInclude.jsp&quot; /> ... <s:textarea theme = &quot;ajax&quot; label=&quot;Description&quot; name=&quot;description&quot; rows=&quot;4&quot; cols=&quot;50&quot; />
  • 33. Brian Kernighan Law of Debugging Difficulty Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
  • 36.  
  • 37.  
  • 38. Built-in Testing Support public class MyActionTest extends StrutsTestCase { public void testExecute() throws Exception { assertTrue(true); } }
  • 44. < action name = &quot;editGangster&quot; class = &quot;org.apache.struts2.s1.Struts1Action&quot; > < param name = &quot;className&quot; > com.mycompany.gangstas.EditGangsterAction </ param > < result > gangsterForm.jsp </ result > </ action > Run Struts 1 Actions as Is
  • 45. How do I get started?
  • 46. Where We are Going