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

More Related Content

What's hot

Redux for ReactJS Programmers
Redux for ReactJS ProgrammersRedux for ReactJS Programmers
Redux for ReactJS Programmers
David 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 App
IronCore Labs
 
ORM Injection
ORM InjectionORM Injection
ORM Injection
Simone Onofri
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid Tags
Johannes Geppert
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
kaven yan
 
Understanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptUnderstanding Asynchronous JavaScript
Understanding Asynchronous JavaScript
jnewmanux
 
Building Advanced XSS Vectors
Building Advanced XSS VectorsBuilding Advanced XSS Vectors
Building Advanced XSS Vectors
Rodolfo Assis (Brute)
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best Pratices
ChengHui Weng
 
GKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroidGKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroid
GDG Korea
 
Reactive, component 그리고 angular2
Reactive, component 그리고  angular2Reactive, component 그리고  angular2
Reactive, component 그리고 angular2
Jeado 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 2013
Laurent_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 June
Deepu S Nath
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
kaven yan
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applications
dominion
 
Server1
Server1Server1
Server1
FahriIrawan3
 
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
Visual Engineering
 
Demystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and ToothpickDemystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and Toothpick
Danny Preussler
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolbox
Shem Magnezi
 
Selectors and normalizing state shape
Selectors and normalizing state shapeSelectors and normalizing state shape
Selectors and normalizing state shape
Muntasir 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 Tests
Tomek Kaczanowski
 

What's hot (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
 

Viewers also liked

seismic retrofitting using precast elements
seismic retrofitting using precast elementsseismic retrofitting using precast elements
seismic retrofitting using precast elements
discorajan
 
Considerations for Seismic Retrofitting
Considerations for Seismic RetrofittingConsiderations for Seismic Retrofitting
Considerations for Seismic Retrofitting
Natural Hazard Mitigation Association
 
Seismic retrofitting techniques of rcc
Seismic retrofitting techniques of rccSeismic retrofitting techniques of rcc
Seismic retrofitting techniques of rcc
Korrapati 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 Joints
amerald24
 
Canal irrigation
Canal irrigationCanal irrigation
Canal irrigation
Pranamesh Chakraborty
 
Seismic Retrofitting Techniques
Seismic Retrofitting TechniquesSeismic Retrofitting Techniques
Seismic Retrofitting Techniques
Aritra Banerjee
 

Viewers also liked (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 to Retrofitting

Struts2
Struts2Struts2
Struts2
yuvalb
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
Matt Raible
 
Ajax
AjaxAjax
Ajax
devisp
 
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
Matt Raible
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
Pamela Fox
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
Hema Prasanth
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
Sanmuga Nathan
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
Doncho Minkov
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query Presentation
Vishal 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é
 
Jquery 1
Jquery 1Jquery 1
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
Ted Husted
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
Carol McDonald
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
MobME Technical
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
borkweb
 

Similar to 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
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
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
 

More from Ted Husted

Ship It!
Ship It!Ship It!
Ship It!
Ted Husted
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.org
Ted Husted
 
The secret life_of_open_source
The secret life_of_open_sourceThe secret life_of_open_source
The secret life_of_open_source
Ted 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 2011
Ted Husted
 
NU FaceBook 101 JCC 2010
NU  FaceBook 101 JCC 2010NU  FaceBook 101 JCC 2010
NU FaceBook 101 JCC 2010
Ted 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 2011
Ted 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_2010
Ted Husted
 
Drupal kickstart-workshop
Drupal kickstart-workshopDrupal kickstart-workshop
Drupal kickstart-workshop
Ted Husted
 
Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010
Ted 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 Simplicity
Ted Husted
 
Testing Web Application Security
Testing Web Application SecurityTesting Web Application Security
Testing Web Application Security
Ted Husted
 
API Doc Smackdown
API Doc SmackdownAPI Doc Smackdown
API Doc Smackdown
Ted Husted
 
Testing The Testers
Testing The TestersTesting The Testers
Testing The Testers
Ted Husted
 
Testing Ajax Applications
Testing Ajax ApplicationsTesting Ajax Applications
Testing Ajax Applications
Ted Husted
 
Testing Ajax Web Applications
Testing Ajax Web ApplicationsTesting Ajax Web Applications
Testing Ajax Web Applications
Ted Husted
 
Testing Tools
Testing ToolsTesting Tools
Testing Tools
Ted Husted
 
Open Source Secret Sauce
Open Source Secret SauceOpen Source Secret Sauce
Open Source Secret Sauce
Ted Husted
 

More from 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
 

Recently uploaded

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 

Recently uploaded (20)

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 

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.