SlideShare a Scribd company logo
1 of 22
Ajax on Struts 2
About Myself

 ●   Chad Davis
 ●   Blackdog Software, Inc.
 ●   J2EE Consulting
 ●   Corporate Training
 ●   Struts 2 in Action
 ●   Open Source Enthusiast
 ●   Debian Devotee
Road Map

●   Something for everyone
●   Struts 2 introduction
●   Ajax introduction
●   Walk through a code sample
●   Questions at any time
Struts 2

●   Web application framework
●   Java Servlets
●   Second generation
●   Software engineering
Classic versus Ajax

    Classic Web Applications
    •



    Ajax Web Applications
    •
Classic Web Applications                            < htm l>
                                                     < head>
                                                       < link rel= quot;stylesheetquot; type= quot;text/cssquot; href= quot;css/ajaxUserBrowser.cssquot; />
                                                     < /head>
                                                     < body>
                                                       < h2> Artist Browser Control< /h2>
                                                       < form nam e= quot;ClassicRetrieveUserquot; action= quot;ClassicRetrieveUser.actionquot;
                                                                                  m ethod= quot;postquot;>
                                                        < select nam e= quot;usernam equot; id= quot;ClassicRetrieveUser_usernam equot;>
                                                        < option value= quot;Jim m yquot;> Jim m y< /option>
                                                        < option value= quot;Charlie Joequot;> Charlie Joe< /option>
                                                        < option value= quot;Maryquot; selected= quot;selectedquot;> Mary< /option>
                                                        < option value= quot;Artyquot;> Arty< /option>
                                                       < /form >
                                                     < /body>
                                                    < /htm l>




URL: /manningSampleApp/chapterEight/ClassicRetrieveUser.action
Data: username=mary
How it works: classic style

●   Browser makes request
    –   Http
    –   URL
    –   Data
●   Server
    –   Processes data
    –   Sends HTML page response
●   Browser receives, renders HTML
<html>
<head>
<link rel=quot;stylesheetquot; type=quot;text/cssquot; href=quot;css/classicUserBrowser.cssquot; />
</head>
<body>
<h2>Artist Browser Control</h2>
<form id=quot;ClassicRetrieveUserquot; name=quot;ClassicRetrieveUserquot; onsubmit=quot;return true;quot;
    action=quot;/manningSampleApp/chapterEight/ClassicRetrieveUser.actionquot; method=quot;postquot;>
<table class=quot;wwFormTablequot;>
    <tr>
        <td class=quot;tdLabelquot;><label for=quot;ClassicRetrieveUser_usernamequot; class=quot;labelquot;>Select an artist:</label></td>
        <td><select name=quot;usernamequot; id=quot;ClassicRetrieveUser_usernamequot;>
            <option value=quot;Jimmyquot;>Jimmy</option>
            <option value=quot;Charlie Joequot;>Charlie Joe</option>
            <option value=quot;Maryquot; selected=quot;selectedquot;>Mary</option>
            <option value=quot;Artyquot;>Arty</option>
        </select></td>
    </tr>
    <tr>
        <td colspan=quot;2quot;>
        <div align=quot;rightquot;><input type=quot;submitquot; id=quot;ClassicRetrieveUser_0quot; value=quot;Submitquot; /></div>
        </td>
    </tr>
</table>
</form>
<hr/>
<h2>Artist Information</h2>
<div id='console'>
<p><span class=quot;browser_labelquot;>Name:</span> Mary Greene</p>
<p><span class=quot;browser_labelquot;>PortfolioName: </span>Wood Cuts</p>
<p><span class=quot;browser_labelquot;>PortfolioName: </span>Oil Paintings</p>
</div>
</body>
</html>
Classic Problems

●   Slow
●   High bandwidth
●   Redundant
●   Page rendering
Ajax Web Applications                              {quot;artistquot;:
                                                             {
                                                                 quot;usernamequot;:quot;Maryquot;,
                                                                 quot;passwordquot;:quot;maxquot;,
                                                                 quot;portfolioNamequot;:quot;Mary's Portfolioquot;,
                                                                 quot;birthdayquot;:quot;2008-10-29 15:10:25.857MDTquot;,
                                                                 quot;firstNamequot;:quot;Maryquot;,
                                                                 quot;lastNamequot;:quot;Greenequot;,
                                                                 quot;receiveJunkMailquot;:quot;falsequot;,
                                                            }
                                                   }




URL: /manningSampleApp/chapterEight/ClassicRetrieveUser.action
Data: username=mary
How it works: Ajax

●   Browser uses Javascript to submit             request
    –   Http
    –   URL
    –   Data
●   Server
    –   Processes data
    –   Sends data response ( JSON, XML, etc. )
●   Browser Javascript
    –   Proceses data
    –   DHTML
{quot;artistquot;:
      {
             quot;usernamequot;:quot;Maryquot;,
             quot;passwordquot;:quot;maxquot;,
             quot;portfolioNamequot;:quot;Mary's Portfolioquot;,
             quot;birthdayquot;:quot;2008-10-29 15:10:25.857MDTquot;,
             quot;firstNamequot;:quot;Maryquot;,
             quot;lastNamequot;:quot;Greenequot;,
             quot;receiveJunkMailquot;:quot;falsequot;,
             quot;portfoliosquot;:{quot;entryquot;:[
                {quot;stringquot;:quot;Wood Cutsquot;, quot;manning.chapterEight.utils.Portfolioquot;:{quot;namequot;:quot;WoodCutsquot;}},
                {quot;stringquot;:quot;Oil Paintingsquot;, manning.chapterEight.utils.Portfolioquot;:{quot;namequot;:quot;Oil Paintingsquot;}}
             ]}
      }
}
Ajax Selling Points

●   Low bandwith
●   No page rendering issues
●   Supports a stronger Separation of Concerns
Observations . . .


  What does the server do?
  The page abstraction: JSP, ASP, PHP
  What should new frameworks do?
Struts 2 Architecture

●   Does all the dirty work for you
●   Separation of Concerns !!
●   Interceptors, Actions, Results, ValueStack
Daily development

●   Actions
    –   you write them
●   Results
    –   declare them
    –   write them if necessary
●   Interceptors
    –   nothing!
    –   declare or write if necessary
Configuration

●   Declare your actions
●   Declare your results
●   XML, Annotations
struts.xml
   <?xml version=quot;1.0quot; encoding=quot;UTF-8quot; ?>
   <!DOCTYPE struts PUBLIC quot;-//Apache Software Foundation//DTD Struts Configuration 2.0//ENquot;
                                                   quot;http://struts.apache.org/dtds/struts-2.0.dtdquot;>


   <struts>


     <package name=quot;chapterEightPublicquot; namespace=quot;/chapterEightquot; extends=quot;struts-defaultquot;>


         <action name=quot;ClassicUserBrowserquot; class=quot;manning.chapterEight.UserBrowserquot;>
               <result>classicUserBrowser.jsp</result>
         </action>


     </package>


   </struts>
Let's code: classic style


     What do we need to write?
            Interceptors?
              Results?
             An Action

             A JSP Page
Let's Code: Ajax Style


     What do we need to write?
             Interceptors?
                Results?
     An Action
     A JSP Page?
     Javascript Client Application
Summary
Ajax – Lower Bandwidth
Ajax – No Page Rendering
Ajax – Javascript Client
   Struts 2 – Second Generation Framework
Ajax – JSON,Built on Software Engineering Principles
   Struts 2 – XML
   Struts 2 – Fast Development, Flexible Architecture

More Related Content

What's hot

Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web StandardsAarron Walter
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書拓樹 谷
 
Illuminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 TutorialIlluminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 Tutorialmikel_maron
 
We9 Struts 2.0
We9 Struts 2.0We9 Struts 2.0
We9 Struts 2.0wangjiaz
 
6주 javaScript 시작하며
6주  javaScript 시작하며6주  javaScript 시작하며
6주 javaScript 시작하며지수 윤
 
Teen Driving - Kimberly Stavropoulos
Teen Driving - Kimberly StavropoulosTeen Driving - Kimberly Stavropoulos
Teen Driving - Kimberly Stavropouloskimmymarie
 
ARTDM 170 Week 3: Rollovers
ARTDM 170 Week 3: RolloversARTDM 170 Week 3: Rollovers
ARTDM 170 Week 3: RolloversGilbert Guerrero
 
Efficient JavaScript Development
Efficient JavaScript DevelopmentEfficient JavaScript Development
Efficient JavaScript Developmentwolframkriesing
 
Clave blanca
Clave blancaClave blanca
Clave blancabapes
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsJohn Brunswick
 
BOOM Performance
BOOM PerformanceBOOM Performance
BOOM Performancedapulse
 

What's hot (20)

Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web Standards
 
Ajax
AjaxAjax
Ajax
 
HTML_HHC
HTML_HHCHTML_HHC
HTML_HHC
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
Illuminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 TutorialIlluminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 Tutorial
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
We9 Struts 2.0
We9 Struts 2.0We9 Struts 2.0
We9 Struts 2.0
 
Html5 101
Html5 101Html5 101
Html5 101
 
6주 javaScript 시작하며
6주  javaScript 시작하며6주  javaScript 시작하며
6주 javaScript 시작하며
 
Teen Driving - Kimberly Stavropoulos
Teen Driving - Kimberly StavropoulosTeen Driving - Kimberly Stavropoulos
Teen Driving - Kimberly Stavropoulos
 
ARTDM 170 Week 3: Rollovers
ARTDM 170 Week 3: RolloversARTDM 170 Week 3: Rollovers
ARTDM 170 Week 3: Rollovers
 
Efficient JavaScript Development
Efficient JavaScript DevelopmentEfficient JavaScript Development
Efficient JavaScript Development
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Clave blanca
Clave blancaClave blanca
Clave blanca
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
 
Html5 101
Html5 101Html5 101
Html5 101
 
Cdddd
CddddCdddd
Cdddd
 
Html5
Html5Html5
Html5
 
BOOM Performance
BOOM PerformanceBOOM Performance
BOOM Performance
 

Viewers also liked

Embedded Linux Odp
Embedded Linux OdpEmbedded Linux Odp
Embedded Linux Odpghessler
 
openHAB @ Eclipse DemoCamp Darmstadt
openHAB @ Eclipse DemoCamp DarmstadtopenHAB @ Eclipse DemoCamp Darmstadt
openHAB @ Eclipse DemoCamp DarmstadtKai Kreuzer
 
openHAB @ Devoxx 2012
openHAB @ Devoxx 2012openHAB @ Devoxx 2012
openHAB @ Devoxx 2012Kai Kreuzer
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BJingfeng Liu
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IOJingfeng Liu
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linuxVandana Salve
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systemsVandana Salve
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chainBohdan Szymanik
 
Practical Applications of Block Chain Technologies
Practical Applications of Block Chain Technologies Practical Applications of Block Chain Technologies
Practical Applications of Block Chain Technologies Priyanka Aash
 
Zigbee network
Zigbee networkZigbee network
Zigbee networkbhavithd
 
Zigbee technology ppt edited
Zigbee technology ppt editedZigbee technology ppt edited
Zigbee technology ppt editedrakeshkumarchary
 

Viewers also liked (16)

Embedded Linux Odp
Embedded Linux OdpEmbedded Linux Odp
Embedded Linux Odp
 
openHAB @ Eclipse DemoCamp Darmstadt
openHAB @ Eclipse DemoCamp DarmstadtopenHAB @ Eclipse DemoCamp Darmstadt
openHAB @ Eclipse DemoCamp Darmstadt
 
openHAB @ Devoxx 2012
openHAB @ Devoxx 2012openHAB @ Devoxx 2012
openHAB @ Devoxx 2012
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IO
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linux
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
Zig Bee
Zig BeeZig Bee
Zig Bee
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chain
 
Basics of Vhdl
Basics of VhdlBasics of Vhdl
Basics of Vhdl
 
Practical Applications of Block Chain Technologies
Practical Applications of Block Chain Technologies Practical Applications of Block Chain Technologies
Practical Applications of Block Chain Technologies
 
Zigbee network
Zigbee networkZigbee network
Zigbee network
 
Zigbee technology ppt edited
Zigbee technology ppt editedZigbee technology ppt edited
Zigbee technology ppt edited
 
Zigbee ppt
Zigbee pptZigbee ppt
Zigbee ppt
 
zigbee full ppt
zigbee full pptzigbee full ppt
zigbee full ppt
 
Zigbee Presentation
Zigbee PresentationZigbee Presentation
Zigbee Presentation
 

Similar to Ajax On S2 Odp

Plone Interactivity
Plone InteractivityPlone Interactivity
Plone InteractivityEric Steele
 
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsSolr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsWildan Maulana
 
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity PresentationRails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentationrailsconf
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
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?goodfriday
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching ResurrectedBen Scofield
 
Couch Db.0.9.0.Pub
Couch Db.0.9.0.PubCouch Db.0.9.0.Pub
Couch Db.0.9.0.PubYohei Sasaki
 
Flickr Open Api Mashup
Flickr Open Api MashupFlickr Open Api Mashup
Flickr Open Api MashupJinho Jung
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On RailsWen-Tien Chang
 
CSIS 138 Javascript Class1
CSIS 138 Javascript Class1CSIS 138 Javascript Class1
CSIS 138 Javascript Class1Teresa Pelkie
 
Grddl In A Nutshell V1
Grddl In A Nutshell V1Grddl In A Nutshell V1
Grddl In A Nutshell V1Fabien Gandon
 
Doctype htmlcodigioooooo
Doctype htmlcodigiooooooDoctype htmlcodigioooooo
Doctype htmlcodigiooooooANDERSON FABIAN
 
07 Collada Overview
07 Collada Overview07 Collada Overview
07 Collada Overviewjohny2008
 

Similar to Ajax On S2 Odp (20)

Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsSolr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJs
 
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity PresentationRails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentation
 
Haml, Sass & Compass
Haml, Sass & CompassHaml, Sass & Compass
Haml, Sass & Compass
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript Basic
 
Widgets Tools Keynote
Widgets Tools KeynoteWidgets Tools Keynote
Widgets Tools Keynote
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
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?
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
 
Couch Db.0.9.0.Pub
Couch Db.0.9.0.PubCouch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
 
Seam Glassfish Slidecast
Seam Glassfish SlidecastSeam Glassfish Slidecast
Seam Glassfish Slidecast
 
JQuery 101
JQuery 101JQuery 101
JQuery 101
 
Flickr Open Api Mashup
Flickr Open Api MashupFlickr Open Api Mashup
Flickr Open Api Mashup
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
Opensocial Codelab
Opensocial CodelabOpensocial Codelab
Opensocial Codelab
 
CSIS 138 Javascript Class1
CSIS 138 Javascript Class1CSIS 138 Javascript Class1
CSIS 138 Javascript Class1
 
Grddl In A Nutshell V1
Grddl In A Nutshell V1Grddl In A Nutshell V1
Grddl In A Nutshell V1
 
Doctype htmlcodigioooooo
Doctype htmlcodigiooooooDoctype htmlcodigioooooo
Doctype htmlcodigioooooo
 
07 Collada Overview
07 Collada Overview07 Collada Overview
07 Collada Overview
 

More from ghessler

Joomla! Installation
Joomla! InstallationJoomla! Installation
Joomla! Installationghessler
 
Joomla Presentation
Joomla PresentationJoomla Presentation
Joomla Presentationghessler
 
Apache Commons Overview
Apache Commons OverviewApache Commons Overview
Apache Commons Overviewghessler
 
Overview Of Xaware
Overview Of XawareOverview Of Xaware
Overview Of Xawareghessler
 
Gimp In Hollywood
Gimp In HollywoodGimp In Hollywood
Gimp In Hollywoodghessler
 
Service Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixService Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixghessler
 

More from ghessler (7)

Joomla! Installation
Joomla! InstallationJoomla! Installation
Joomla! Installation
 
Joomla Presentation
Joomla PresentationJoomla Presentation
Joomla Presentation
 
Apache Commons Overview
Apache Commons OverviewApache Commons Overview
Apache Commons Overview
 
Overview Of Xaware
Overview Of XawareOverview Of Xaware
Overview Of Xaware
 
Gimp In Hollywood
Gimp In HollywoodGimp In Hollywood
Gimp In Hollywood
 
JCatapult
JCatapultJCatapult
JCatapult
 
Service Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixService Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMix
 

Recently uploaded

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Ajax On S2 Odp

  • 2. About Myself ● Chad Davis ● Blackdog Software, Inc. ● J2EE Consulting ● Corporate Training ● Struts 2 in Action ● Open Source Enthusiast ● Debian Devotee
  • 3. Road Map ● Something for everyone ● Struts 2 introduction ● Ajax introduction ● Walk through a code sample ● Questions at any time
  • 4. Struts 2 ● Web application framework ● Java Servlets ● Second generation ● Software engineering
  • 5. Classic versus Ajax Classic Web Applications • Ajax Web Applications •
  • 6. Classic Web Applications < htm l> < head> < link rel= quot;stylesheetquot; type= quot;text/cssquot; href= quot;css/ajaxUserBrowser.cssquot; /> < /head> < body> < h2> Artist Browser Control< /h2> < form nam e= quot;ClassicRetrieveUserquot; action= quot;ClassicRetrieveUser.actionquot; m ethod= quot;postquot;> < select nam e= quot;usernam equot; id= quot;ClassicRetrieveUser_usernam equot;> < option value= quot;Jim m yquot;> Jim m y< /option> < option value= quot;Charlie Joequot;> Charlie Joe< /option> < option value= quot;Maryquot; selected= quot;selectedquot;> Mary< /option> < option value= quot;Artyquot;> Arty< /option> < /form > < /body> < /htm l> URL: /manningSampleApp/chapterEight/ClassicRetrieveUser.action Data: username=mary
  • 7. How it works: classic style ● Browser makes request – Http – URL – Data ● Server – Processes data – Sends HTML page response ● Browser receives, renders HTML
  • 8. <html> <head> <link rel=quot;stylesheetquot; type=quot;text/cssquot; href=quot;css/classicUserBrowser.cssquot; /> </head> <body> <h2>Artist Browser Control</h2> <form id=quot;ClassicRetrieveUserquot; name=quot;ClassicRetrieveUserquot; onsubmit=quot;return true;quot; action=quot;/manningSampleApp/chapterEight/ClassicRetrieveUser.actionquot; method=quot;postquot;> <table class=quot;wwFormTablequot;> <tr> <td class=quot;tdLabelquot;><label for=quot;ClassicRetrieveUser_usernamequot; class=quot;labelquot;>Select an artist:</label></td> <td><select name=quot;usernamequot; id=quot;ClassicRetrieveUser_usernamequot;> <option value=quot;Jimmyquot;>Jimmy</option> <option value=quot;Charlie Joequot;>Charlie Joe</option> <option value=quot;Maryquot; selected=quot;selectedquot;>Mary</option> <option value=quot;Artyquot;>Arty</option> </select></td> </tr> <tr> <td colspan=quot;2quot;> <div align=quot;rightquot;><input type=quot;submitquot; id=quot;ClassicRetrieveUser_0quot; value=quot;Submitquot; /></div> </td> </tr> </table> </form> <hr/> <h2>Artist Information</h2> <div id='console'> <p><span class=quot;browser_labelquot;>Name:</span> Mary Greene</p> <p><span class=quot;browser_labelquot;>PortfolioName: </span>Wood Cuts</p> <p><span class=quot;browser_labelquot;>PortfolioName: </span>Oil Paintings</p> </div> </body> </html>
  • 9. Classic Problems ● Slow ● High bandwidth ● Redundant ● Page rendering
  • 10. Ajax Web Applications {quot;artistquot;: { quot;usernamequot;:quot;Maryquot;, quot;passwordquot;:quot;maxquot;, quot;portfolioNamequot;:quot;Mary's Portfolioquot;, quot;birthdayquot;:quot;2008-10-29 15:10:25.857MDTquot;, quot;firstNamequot;:quot;Maryquot;, quot;lastNamequot;:quot;Greenequot;, quot;receiveJunkMailquot;:quot;falsequot;, } } URL: /manningSampleApp/chapterEight/ClassicRetrieveUser.action Data: username=mary
  • 11. How it works: Ajax ● Browser uses Javascript to submit request – Http – URL – Data ● Server – Processes data – Sends data response ( JSON, XML, etc. ) ● Browser Javascript – Proceses data – DHTML
  • 12. {quot;artistquot;: { quot;usernamequot;:quot;Maryquot;, quot;passwordquot;:quot;maxquot;, quot;portfolioNamequot;:quot;Mary's Portfolioquot;, quot;birthdayquot;:quot;2008-10-29 15:10:25.857MDTquot;, quot;firstNamequot;:quot;Maryquot;, quot;lastNamequot;:quot;Greenequot;, quot;receiveJunkMailquot;:quot;falsequot;, quot;portfoliosquot;:{quot;entryquot;:[ {quot;stringquot;:quot;Wood Cutsquot;, quot;manning.chapterEight.utils.Portfolioquot;:{quot;namequot;:quot;WoodCutsquot;}}, {quot;stringquot;:quot;Oil Paintingsquot;, manning.chapterEight.utils.Portfolioquot;:{quot;namequot;:quot;Oil Paintingsquot;}} ]} } }
  • 13. Ajax Selling Points ● Low bandwith ● No page rendering issues ● Supports a stronger Separation of Concerns
  • 14. Observations . . . What does the server do? The page abstraction: JSP, ASP, PHP What should new frameworks do?
  • 15. Struts 2 Architecture ● Does all the dirty work for you ● Separation of Concerns !! ● Interceptors, Actions, Results, ValueStack
  • 16.
  • 17. Daily development ● Actions – you write them ● Results – declare them – write them if necessary ● Interceptors – nothing! – declare or write if necessary
  • 18. Configuration ● Declare your actions ● Declare your results ● XML, Annotations
  • 19. struts.xml <?xml version=quot;1.0quot; encoding=quot;UTF-8quot; ?> <!DOCTYPE struts PUBLIC quot;-//Apache Software Foundation//DTD Struts Configuration 2.0//ENquot; quot;http://struts.apache.org/dtds/struts-2.0.dtdquot;> <struts> <package name=quot;chapterEightPublicquot; namespace=quot;/chapterEightquot; extends=quot;struts-defaultquot;> <action name=quot;ClassicUserBrowserquot; class=quot;manning.chapterEight.UserBrowserquot;> <result>classicUserBrowser.jsp</result> </action> </package> </struts>
  • 20. Let's code: classic style What do we need to write? Interceptors? Results? An Action A JSP Page
  • 21. Let's Code: Ajax Style What do we need to write? Interceptors? Results? An Action A JSP Page? Javascript Client Application
  • 22. Summary Ajax – Lower Bandwidth Ajax – No Page Rendering Ajax – Javascript Client Struts 2 – Second Generation Framework Ajax – JSON,Built on Software Engineering Principles Struts 2 – XML Struts 2 – Fast Development, Flexible Architecture

Editor's Notes

  1. Plus images, css, etc.This is a very small page.
  2. show amazon page refresh
  3. XMLHttpRequest