SlideShare una empresa de Scribd logo
1 de 83
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Struts on Ajax:  Retrofitting Struts with Ajax Taglibs Tuesday, September 30th, 9a-10a Ted Husted
Struts on Ajax:  Retrofitting Struts with Ajax Taglibs Square One University Series
[object Object],[object Object],Struts on Ajax
Abstract ,[object Object],[object Object],[object Object],[object Object],[object Object]
Retrofitting Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
Retrofitting Struts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Retrofitting Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
What is Ajax? ,[object Object],[object Object],[object Object],[object Object]
What was life like before Ajax? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How does Ajax work? ,[object Object],[object Object],[object Object],[object Object]
Can we use Ajax in a Struts app? ,[object Object],[object Object],[object Object],[object Object],[object Object]
public   class  IndexResult  extends  Action { public  ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)  throws  Exception { response.setContentType( "text/html" ); PrintWriter out = response.getWriter(); out.println( "Hello World! “ +  “ This is an AJAX response “ +  “ from a Struts Action." ); out.flush(); return   null ; } } actions.IndexResult.java
public   class  IndexResult2  extends ActionSupport { private  InputStream  inputStream ; public  InputStream getInputStream() { return   inputStream ; } public  String execute()  throws  Exception { inputStream =  new  StringBufferInputStream( "Hello World! This is an AJAX response " +  "from a Struts 2 Action." ); return   SUCCESS ; } } actions.IndexResult2.java
What are some pure Ajax Libraries? ,[object Object],[object Object]
http://www.prototypejs.org/
http://jquery.com/
What are some Ajax UI Libraries? ,[object Object],[object Object]
[object Object]
[object Object]
Are there Ajax JSP tag libraries? ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
Retrofitting Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
Why choose AjaxParts Taglib? ,[object Object],[object Object],[object Object],[object Object]
Why choose AjaxParts Taglib? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Retrofitting Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
How about a Simple Hello World Example? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How about a Simple Hello World Example? ,[object Object],[object Object],[object Object],[object Object],[object Object]
< html > < head > < title > Simple Hello World Example </ title > </ head > < body > < input  id = &quot;hello-button&quot;  type = &quot;button&quot;  value = &quot;Say Hello World via AJAX&quot;  /> < br  />< br  /> < div  id = &quot;hello-div&quot; ></ div > </ body > </ html > index.jsp
<%@  taglib  prefix = &quot;ajax&quot;  uri = &quot;javawebparts/ajaxparts/taglib&quot;  %> < html > < head > < title > Simple Hello World Example </ title > </ head > < body > < input  id = &quot;hello-button&quot;   type = &quot;button&quot;  value = &quot;Say Hello World via AJAX&quot;  /> < ajax:event  attachTo = &quot;hello-button&quot; ajaxRef = &quot;index/hello-button&quot; /> < br  />< br  /> < div  id = &quot;hello-div&quot; ></ div > < ajax:enable  /> </ body > </ html > index.jsp
ajax-config.xml < ajaxConfig > < group  ajaxRef = &quot;index&quot; > < element  ajaxRef = &quot;hello-button&quot; > < event  type = &quot;onclick&quot; > < requestHandler  type = &quot;std:SimpleRequest&quot; target = &quot; index-result.txt &quot; > < parameter  /> </ requestHandler > < responseHandler  type = &quot;std:InnerHTML&quot; > < parameter > hello-div </ parameter > </ responseHandler > </ event > </ element > </ group > </ ajaxConfig >
Hello World! I am an AJAX result from the (mock) server. index-result.txt
<web-app> <context-param> <param-name> AjaxPartsTaglibConfig </param-name> <param-value> /WEB-INF/ajax-config.xml </param-value>   </context-param> <context-param> <param-name> AjaxPartsTaglibValidateConfig </param-name> <param-value> false </param-value> </context-param> web.xml
What JARS do we need? ,[object Object],[object Object],[object Object]
 
 
Can we use a Struts action instead? ,[object Object]
public   class  IndexResult  extends  Action { public  ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)  throws  Exception { response.setContentType( &quot;text/html&quot; ); PrintWriter out = response.getWriter(); out.println( &quot;Hello World! “ +  “ This is an AJAX response “ +  “ from a Struts Action.&quot; ); out.flush(); return   null ; } } actions.IndexResult.java
< action path = &quot;/index-result&quot; type = &quot;actions.IndexResult&quot; validate = &quot;false&quot;  /> struts-config.xml
<requestHandler type=&quot;std:SimpleRequest&quot; target=&quot;index-result.txt&quot;>   < requestHandler  type = &quot;std:SimpleRequest&quot; target = &quot;/index-result.do&quot; >   ajax-config.xml
 
How about Struts 2? ,[object Object],[object Object],[object Object]
public   class  IndexResult2  extends ActionSupport { private  InputStream  inputStream ; public  InputStream getInputStream() { return   inputStream ; } public  String execute()  throws  Exception { inputStream =  new  StringBufferInputStream( &quot;Hello World! This is an AJAX response &quot; +  &quot;from a Struts 2 Action.&quot; ); return   SUCCESS ; } } actions.IndexResult2.java
< package  name = &quot;ajaxwebparts&quot;  extends = &quot;struts-default&quot; > < action  name = &quot;index-result&quot; class = &quot;actions.IndexResult2&quot; > < result  type = &quot;stream&quot; > < param  name = &quot;contentType&quot; > text/html </ param > < param  name = &quot;inputName&quot; > inputStream </ param > </ result > </ action > </ package > struts.xml
<requestHandler type=&quot;std:SimpleRequest&quot; target=&quot;/index-result.do&quot;>   < requestHandler  type = &quot;std:SimpleRequest&quot; target = &quot;/index-result.action&quot; >   ajax-config.xml
 
Is it really that easy? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Retrofitting Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
How does AjaxParts work? ,[object Object],[object Object],[object Object]
< ajaxConfig > < group  ajaxRef = &quot; index &quot; > < element  ajaxRef = &quot; hello-button &quot; > < event  type = &quot;onclick&quot; > < requestHandler  type = &quot;std:SimpleRequest&quot;  target = &quot; index-result.action &quot; > < parameter  /> How does AjaxParts work? <body> < input  id = &quot;hello-button&quot;   type = &quot;button&quot;  value = &quot;Say Hello World via AJAX&quot;  /> < ajax:event  attachTo = &quot;hello-button“ ajaxRef = &quot; index/hello-button &quot;  />
< responseHandler  type = &quot;std:InnerHTML&quot; > < parameter > hello-div </ parameter > </ responseHandler > < br  />< br  /> < div  id = &quot; hello-div &quot; ></ div > </ body > < ajax:enable  /> How does AjaxParts work?
What does <ajax:event> do? ,[object Object]
What does <ajax:event> do? < input  id = &quot;helloButton&quot;  type = &quot;button&quot;  value = &quot;Say Hello World via AJAX&quot;  /> < ajax:event    attachTo = &quot;helloButton&quot;    ajaxRef = &quot;index/hello-button&quot; /> ,[object Object]
What does <ajax:enable> do? ,[object Object],[object Object],[object Object]
What requestHandlers are there? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What requestHandlers are there? ,[object Object],[object Object],[object Object],[object Object]
What responseHandlers are there? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What responseHandlers are there? ,[object Object],[object Object],[object Object],[object Object]
What responseHandlers are there? ,[object Object],[object Object],[object Object],[object Object],[object Object]
What responseHandlers are there? ,[object Object],[object Object]
Is that all there is to AjaxParts? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Is that all there is to AjaxParts? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Is that all there is to AjaxParts? ,[object Object],[object Object],[object Object],[object Object]
Other Struts 1 Ajax Resources ,[object Object],[object Object],[object Object],[object Object]
Retrofitting Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
Are there new alternatives for Struts 2? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How do the S2 Ajax Tags work?  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How do the S2 Ajax Tags work?  ,[object Object],[object Object],[object Object],[object Object]
How do the S2 Ajax Tags work?  ,[object Object],[object Object],[object Object],[object Object]
 
 
 
<%@  taglib  prefix = &quot;yui&quot;  uri = &quot;/struts-yui-tags&quot;  %> <%@  taglib  prefix = &quot;s&quot;  uri = &quot;/struts-tags&quot;  %> < html > < head > < yui:head  datepicker = &quot;true&quot;  /> </ head > < body > < p > The selected date is    < s:property  value = &quot;datepicker&quot; /></ p > < s:form  action = &quot;datepicker&quot; > < yui:datepicker  id = &quot;datepicker&quot;   name = &quot;datepicker&quot; /> < s:submit  /> </ s:form >   </ body > </ html > datepicker.jsp
< action  name = &quot;datepicker&quot;  class = &quot;actions.Datepicker&quot; > < result > datepicker.jsp </ result > </ action > struts.xml
public   class  Datepicker  extends  ActionSupport { private  Date  datepicker ; public  Date getDatepicker() { return   datepicker ; } public   void  setDatepicker(Date value) { datepicker  = value; } } actions.DatePicker.java
 
Are there other Struts 2  Ajax resources?  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Is that all there is? ,[object Object],[object Object],[object Object],[object Object]
JSON-P support in APT ,[object Object],[object Object],[object Object],[object Object],[object Object]
Struts University Series

Más contenido relacionado

La actualidad más candente

Redux for ReactJS Programmers
Redux for ReactJS ProgrammersRedux for ReactJS Programmers
Redux for ReactJS ProgrammersDavid Rodenas
 
How to Add End-to-End Encryption to Your React App
How to Add End-to-End Encryption to Your React AppHow to Add End-to-End Encryption to Your React App
How to Add End-to-End Encryption to Your React AppIronCore Labs
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsJohannes Geppert
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Domkaven yan
 
Understanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptUnderstanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptjnewmanux
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best PraticesChengHui Weng
 
GKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroidGKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroidGDG Korea
 
Reactive, component 그리고 angular2
Reactive, component 그리고  angular2Reactive, component 그리고  angular2
Reactive, component 그리고 angular2Jeado Ko
 
Developing web-apps like it's 2013
Developing web-apps like it's 2013Developing web-apps like it's 2013
Developing web-apps like it's 2013Laurent_VB
 
Understanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG JuneUnderstanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG JuneDeepu S Nath
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performancekaven yan
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applicationsdominion
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideVisual Engineering
 
Demystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and ToothpickDemystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and ToothpickDanny Preussler
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolboxShem Magnezi
 
Selectors and normalizing state shape
Selectors and normalizing state shapeSelectors and normalizing state shape
Selectors and normalizing state shapeMuntasir Chowdhury
 
33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good TestsTomek Kaczanowski
 

La actualidad más candente (20)

Redux for ReactJS Programmers
Redux for ReactJS ProgrammersRedux for ReactJS Programmers
Redux for ReactJS Programmers
 
How to Add End-to-End Encryption to Your React App
How to Add End-to-End Encryption to Your React AppHow to Add End-to-End Encryption to Your React App
How to Add End-to-End Encryption to Your React App
 
ORM Injection
ORM InjectionORM Injection
ORM Injection
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid Tags
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
Understanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptUnderstanding Asynchronous JavaScript
Understanding Asynchronous JavaScript
 
Building Advanced XSS Vectors
Building Advanced XSS VectorsBuilding Advanced XSS Vectors
Building Advanced XSS Vectors
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best Pratices
 
GKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroidGKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroid
 
Reactive, component 그리고 angular2
Reactive, component 그리고  angular2Reactive, component 그리고  angular2
Reactive, component 그리고 angular2
 
Developing web-apps like it's 2013
Developing web-apps like it's 2013Developing web-apps like it's 2013
Developing web-apps like it's 2013
 
Understanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG JuneUnderstanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG June
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applications
 
Server1
Server1Server1
Server1
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
 
Demystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and ToothpickDemystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and Toothpick
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolbox
 
Selectors and normalizing state shape
Selectors and normalizing state shapeSelectors and normalizing state shape
Selectors and normalizing state shape
 
33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests
 

Destacado

seismic retrofitting using precast elements
seismic retrofitting using precast elementsseismic retrofitting using precast elements
seismic retrofitting using precast elementsdiscorajan
 
Seismic retrofitting techniques of rcc
Seismic retrofitting techniques of rccSeismic retrofitting techniques of rcc
Seismic retrofitting techniques of rccKorrapati Pratyusha
 
Repair and Retrofit on Beam and Column Joints
Repair and Retrofit on Beam and Column JointsRepair and Retrofit on Beam and Column Joints
Repair and Retrofit on Beam and Column Jointsamerald24
 
Seismic Retrofitting Techniques
Seismic Retrofitting TechniquesSeismic Retrofitting Techniques
Seismic Retrofitting TechniquesAritra Banerjee
 

Destacado (6)

seismic retrofitting using precast elements
seismic retrofitting using precast elementsseismic retrofitting using precast elements
seismic retrofitting using precast elements
 
Considerations for Seismic Retrofitting
Considerations for Seismic RetrofittingConsiderations for Seismic Retrofitting
Considerations for Seismic Retrofitting
 
Seismic retrofitting techniques of rcc
Seismic retrofitting techniques of rccSeismic retrofitting techniques of rcc
Seismic retrofitting techniques of rcc
 
Repair and Retrofit on Beam and Column Joints
Repair and Retrofit on Beam and Column JointsRepair and Retrofit on Beam and Column Joints
Repair and Retrofit on Beam and Column Joints
 
Canal irrigation
Canal irrigationCanal irrigation
Canal irrigation
 
Seismic Retrofitting Techniques
Seismic Retrofitting TechniquesSeismic Retrofitting Techniques
Seismic Retrofitting Techniques
 

Similar a Retrofitting

Struts2
Struts2Struts2
Struts2yuvalb
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
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 2Matt Raible
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0Matt Raible
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop NotesPamela Fox
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet Sagar Nakul
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet Sagar Nakul
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query PresentationVishal Kumar
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2borkweb
 

Similar a Retrofitting (20)

Struts2
Struts2Struts2
Struts2
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
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
 
Ajax
AjaxAjax
Ajax
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query Presentation
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Jquery 1
Jquery 1Jquery 1
Jquery 1
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 

Más de Ted Husted

.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.orgTed Husted
 
The secret life_of_open_source
The secret life_of_open_sourceThe secret life_of_open_source
The secret life_of_open_sourceTed Husted
 
Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011Ted Husted
 
NU FaceBook 101 JCC 2010
NU  FaceBook 101 JCC 2010NU  FaceBook 101 JCC 2010
NU FaceBook 101 JCC 2010Ted Husted
 
Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011Ted Husted
 
Open source secret_sauce_apache_con_2010
Open source secret_sauce_apache_con_2010Open source secret_sauce_apache_con_2010
Open source secret_sauce_apache_con_2010Ted Husted
 
Drupal kickstart-workshop
Drupal kickstart-workshopDrupal kickstart-workshop
Drupal kickstart-workshopTed Husted
 
Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010Ted Husted
 
Agile Analysis with Use Cases: Balancing Utility with Simplicity
Agile Analysis with Use Cases: Balancing Utility with SimplicityAgile Analysis with Use Cases: Balancing Utility with Simplicity
Agile Analysis with Use Cases: Balancing Utility with SimplicityTed Husted
 
Testing Web Application Security
Testing Web Application SecurityTesting Web Application Security
Testing Web Application SecurityTed Husted
 
API Doc Smackdown
API Doc SmackdownAPI Doc Smackdown
API Doc SmackdownTed Husted
 
Testing The Testers
Testing The TestersTesting The Testers
Testing The TestersTed Husted
 
Testing Ajax Applications
Testing Ajax ApplicationsTesting Ajax Applications
Testing Ajax ApplicationsTed Husted
 
Testing Ajax Web Applications
Testing Ajax Web ApplicationsTesting Ajax Web Applications
Testing Ajax Web ApplicationsTed Husted
 
Open Source Secret Sauce
Open Source Secret SauceOpen Source Secret Sauce
Open Source Secret SauceTed Husted
 

Más de Ted Husted (17)

Ship It!
Ship It!Ship It!
Ship It!
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.org
 
The secret life_of_open_source
The secret life_of_open_sourceThe secret life_of_open_source
The secret life_of_open_source
 
Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011Open Source Secret Sauce - Lugor Sep 2011
Open Source Secret Sauce - Lugor Sep 2011
 
NU FaceBook 101 JCC 2010
NU  FaceBook 101 JCC 2010NU  FaceBook 101 JCC 2010
NU FaceBook 101 JCC 2010
 
Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011
 
Open source secret_sauce_apache_con_2010
Open source secret_sauce_apache_con_2010Open source secret_sauce_apache_con_2010
Open source secret_sauce_apache_con_2010
 
Drupal kickstart-workshop
Drupal kickstart-workshopDrupal kickstart-workshop
Drupal kickstart-workshop
 
Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010
 
Agile Analysis with Use Cases: Balancing Utility with Simplicity
Agile Analysis with Use Cases: Balancing Utility with SimplicityAgile Analysis with Use Cases: Balancing Utility with Simplicity
Agile Analysis with Use Cases: Balancing Utility with Simplicity
 
Testing Web Application Security
Testing Web Application SecurityTesting Web Application Security
Testing Web Application Security
 
API Doc Smackdown
API Doc SmackdownAPI Doc Smackdown
API Doc Smackdown
 
Testing The Testers
Testing The TestersTesting The Testers
Testing The Testers
 
Testing Ajax Applications
Testing Ajax ApplicationsTesting Ajax Applications
Testing Ajax Applications
 
Testing Ajax Web Applications
Testing Ajax Web ApplicationsTesting Ajax Web Applications
Testing Ajax Web Applications
 
Testing Tools
Testing ToolsTesting Tools
Testing Tools
 
Open Source Secret Sauce
Open Source Secret SauceOpen Source Secret Sauce
Open Source Secret Sauce
 

Último

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Retrofitting

  • 1.
  • 2. Struts on Ajax: Retrofitting Struts with Ajax Taglibs Square One University Series
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. public class IndexResult extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { response.setContentType( &quot;text/html&quot; ); PrintWriter out = response.getWriter(); out.println( &quot;Hello World! “ + “ This is an AJAX response “ + “ from a Struts Action.&quot; ); out.flush(); return null ; } } actions.IndexResult.java
  • 13. public class IndexResult2 extends ActionSupport { private InputStream inputStream ; public InputStream getInputStream() { return inputStream ; } public String execute() throws Exception { inputStream = new StringBufferInputStream( &quot;Hello World! This is an AJAX response &quot; + &quot;from a Struts 2 Action.&quot; ); return SUCCESS ; } } actions.IndexResult2.java
  • 14.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. < html > < head > < title > Simple Hello World Example </ title > </ head > < body > < input id = &quot;hello-button&quot; type = &quot;button&quot; value = &quot;Say Hello World via AJAX&quot; /> < br />< br /> < div id = &quot;hello-div&quot; ></ div > </ body > </ html > index.jsp
  • 33. <%@ taglib prefix = &quot;ajax&quot; uri = &quot;javawebparts/ajaxparts/taglib&quot; %> < html > < head > < title > Simple Hello World Example </ title > </ head > < body > < input id = &quot;hello-button&quot; type = &quot;button&quot; value = &quot;Say Hello World via AJAX&quot; /> < ajax:event attachTo = &quot;hello-button&quot; ajaxRef = &quot;index/hello-button&quot; /> < br />< br /> < div id = &quot;hello-div&quot; ></ div > < ajax:enable /> </ body > </ html > index.jsp
  • 34. ajax-config.xml < ajaxConfig > < group ajaxRef = &quot;index&quot; > < element ajaxRef = &quot;hello-button&quot; > < event type = &quot;onclick&quot; > < requestHandler type = &quot;std:SimpleRequest&quot; target = &quot; index-result.txt &quot; > < parameter /> </ requestHandler > < responseHandler type = &quot;std:InnerHTML&quot; > < parameter > hello-div </ parameter > </ responseHandler > </ event > </ element > </ group > </ ajaxConfig >
  • 35. Hello World! I am an AJAX result from the (mock) server. index-result.txt
  • 36. <web-app> <context-param> <param-name> AjaxPartsTaglibConfig </param-name> <param-value> /WEB-INF/ajax-config.xml </param-value> </context-param> <context-param> <param-name> AjaxPartsTaglibValidateConfig </param-name> <param-value> false </param-value> </context-param> web.xml
  • 37.
  • 38.  
  • 39.  
  • 40.
  • 41. public class IndexResult extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { response.setContentType( &quot;text/html&quot; ); PrintWriter out = response.getWriter(); out.println( &quot;Hello World! “ + “ This is an AJAX response “ + “ from a Struts Action.&quot; ); out.flush(); return null ; } } actions.IndexResult.java
  • 42. < action path = &quot;/index-result&quot; type = &quot;actions.IndexResult&quot; validate = &quot;false&quot; /> struts-config.xml
  • 43. <requestHandler type=&quot;std:SimpleRequest&quot; target=&quot;index-result.txt&quot;> < requestHandler type = &quot;std:SimpleRequest&quot; target = &quot;/index-result.do&quot; > ajax-config.xml
  • 44.  
  • 45.
  • 46. public class IndexResult2 extends ActionSupport { private InputStream inputStream ; public InputStream getInputStream() { return inputStream ; } public String execute() throws Exception { inputStream = new StringBufferInputStream( &quot;Hello World! This is an AJAX response &quot; + &quot;from a Struts 2 Action.&quot; ); return SUCCESS ; } } actions.IndexResult2.java
  • 47. < package name = &quot;ajaxwebparts&quot; extends = &quot;struts-default&quot; > < action name = &quot;index-result&quot; class = &quot;actions.IndexResult2&quot; > < result type = &quot;stream&quot; > < param name = &quot;contentType&quot; > text/html </ param > < param name = &quot;inputName&quot; > inputStream </ param > </ result > </ action > </ package > struts.xml
  • 48. <requestHandler type=&quot;std:SimpleRequest&quot; target=&quot;/index-result.do&quot;> < requestHandler type = &quot;std:SimpleRequest&quot; target = &quot;/index-result.action&quot; > ajax-config.xml
  • 49.  
  • 50.
  • 51.
  • 52.
  • 53. < ajaxConfig > < group ajaxRef = &quot; index &quot; > < element ajaxRef = &quot; hello-button &quot; > < event type = &quot;onclick&quot; > < requestHandler type = &quot;std:SimpleRequest&quot; target = &quot; index-result.action &quot; > < parameter /> How does AjaxParts work? <body> < input id = &quot;hello-button&quot; type = &quot;button&quot; value = &quot;Say Hello World via AJAX&quot; /> < ajax:event attachTo = &quot;hello-button“ ajaxRef = &quot; index/hello-button &quot; />
  • 54. < responseHandler type = &quot;std:InnerHTML&quot; > < parameter > hello-div </ parameter > </ responseHandler > < br />< br /> < div id = &quot; hello-div &quot; ></ div > </ body > < ajax:enable /> How does AjaxParts work?
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.  
  • 74.  
  • 75.  
  • 76. <%@ taglib prefix = &quot;yui&quot; uri = &quot;/struts-yui-tags&quot; %> <%@ taglib prefix = &quot;s&quot; uri = &quot;/struts-tags&quot; %> < html > < head > < yui:head datepicker = &quot;true&quot; /> </ head > < body > < p > The selected date is < s:property value = &quot;datepicker&quot; /></ p > < s:form action = &quot;datepicker&quot; > < yui:datepicker id = &quot;datepicker&quot; name = &quot;datepicker&quot; /> < s:submit /> </ s:form > </ body > </ html > datepicker.jsp
  • 77. < action name = &quot;datepicker&quot; class = &quot;actions.Datepicker&quot; > < result > datepicker.jsp </ result > </ action > struts.xml
  • 78. public class Datepicker extends ActionSupport { private Date datepicker ; public Date getDatepicker() { return datepicker ; } public void setDatepicker(Date value) { datepicker = value; } } actions.DatePicker.java
  • 79.  
  • 80.
  • 81.
  • 82.