SlideShare a Scribd company logo
1 of 22
Download to read offline
JSF and AJAX with
  Netbeans 5.5

      Wanasanan Thongsongkrit
                     (NAS) :)
AJAX




       2
AJAX’s shortcoming
 Because AJAX is new, it has very inconsistent
  support among browsers.
 Also, to develop with AJAX, you need to have
  some knowledge of JavaScript, which is out of
  reach for many page authors.




                                                  3
Learning AJAX
   Fast (easy) if you                 Slow (hard) if you
       are a JavaScript guru              come from a mostly static
       have memorized the entire           HTML/CSS background
        DOM API                            are comfortable with
       own and study books on              traditional web application
        DHTML, JavaScript, CSS,             architectures built around
        AJAX and useful hacks for           an HTTP POST
        each technology                    primary use of JavaScript
                                            is cut-and-paste of cute
                                            animations and other cool
                                            in-page behaviors



                                                                          4
AJAX toolkits
   The complete list indicates some 160 toolkits exist
   Keith provided a pointer to a popularity survey of AJAX
    toolkits (as of September 23, 2006)
       Prototype (48%)
       Script.aculo.us (33%)
       Dojo (19%)
       DWR (12%)
       Moo.fx (11%)
       jQuery (7%)
       Rico (5%)
       Yahoo UI (5%)
       Atlas (4%)
       MochiKit (4%)
       XAjAX (4%)
       GWT (3%)                                              5
How to avoid learning javascript
and all toolkits?
   Use components that encapsulate AJAX inside
   Benefits
       Hide functionality behind simple building blocks
       Page author do not have to write all java scripts themselves but
        let the component do the complicated work
       Page authors have an easier time maintaining their pages
       Reusable components
   Technology used: Java Server Faces (JSF)
       author can just drag and drop the components onto a page using
        a tool such as Sun Java Studio Creator or the NetBeans IDE.



                                                                           6
Create Great-Looking GUIs With
NetBeans IDE 5.5




                                 7
NetBeans Enterprise Pack
(Beta version)




                           8
jMaki Framework (plug-in)
   JavaScript Wrapper framework for the Java platform
   wraps popular AJAX frameworks into a JSP or JSF tag
   Provides a common programming model to developers
   Familiar to Java EE application developers
   Leverages the widgets from popular frameworks (See)

     Dojo             Flickr        Google         Scriptaculus
    Mochikit          Spry          Yahoo          DHTML


   What you need is: jMaki Plug-in
    https://ajax.dev.java.net/files/documents/3115/41646/
    org-netbeans-modules-sun-jmaki.nbm

                                                                  9
Basic jMaki                             <a:ajax name="jmaki.delicious"/>
Application
Structure
jmaki.js  the JavaScript
bootstrapper and utilities that
manages
• the loading of jMaki widgets
on the client,
• makes XMLHttpRequests,
• loads additional resources,
• provides inter-widget
communication using publish
and subscribe
• stores widget instances to be
shared across an application.     config.json  configuration of      10
                                  3rd party libraries used by jMaki
jMaki:
   made up of JavaScript Runtime, the Server Side
    Runtime, and the XmlHttpProxy.




                                                     11
JavaScript Runtime (jmaki.js)
   responsible for
        bootstrapping all widgets and passing parameters provided by a
         server-side runtime.
        makes sure that each widget instance gets the correct parameters
         that were passed from the server-side runtime.
        uses default parameters (if not provided) that may then be
         customized for each widget.
        provides convenient APIs for performing an XMLHttpRequest
         and loading resources based on JSON with Padding (JSONP).
        provides APIs for a widget to load extra scripts, styles, and
         resources needed by a widget.
        provides a publish subscribe mechanism for widget-based
         communication.
        provides a common namespace to store and access widgets
        The key point of the API is that you can program to            12

          one API and access widgets from any given toolkit.
Server-Side Runtime
   responsible for
       applying changes and rendering HTML templates.
       renders all script and CSS references based on which
        type is centrally configured.
       responsible for serializing parameters (specified as
        attributes in a JSP or JSF tag) that are passed to the
        JavaScript runtime.
       capable of mapping widget values back into server-
        based model data, such as managed objects, web
        services, or databases.

                                                                 13
XmlHttpProxy
   provides a generic JSON-based access to a
    widget range of XML-based services using an
    HTTP client.
       services include RSS feeds, Yahoo services such as
        geocoding, Flickr image searches, and many more to
        come.
   allows widgets to access services in a uniform
    way by providing XSL-to-JSON transformations
    that can be easily customized.

                                                             14
How author configure
widgets’ parameters via jMaki?
   using JSON

                                jMaki Widget
                    JSON

                 (parameters)
                                  wrapped
                                  Widget




                                               15
Using Your Own Data With a
jMaki Widget
   to add your own data to a widget (JSON format):
       Using a static file
       Using a JavaServer Faces managed bean
       Using a JSP page or a servlet




                                                  16
Demo: Publish and Subscribe
 Mechanism with Yahoo Geocoder
<a:ajax name="yahoo.geocoder" service="/xhp"/>                      widget

<script type="text/javascript">                                 Subscribe
  function geoCoderListener(coordinates) {
  var targetDiv = document.getElementById("geocoder001_message");
  var reponseText = "";
  for (var i in coordinates) {
     reponseText += "Latitude=" + coordinates[i].latitude + " Longitude=" +
    coordinates[i].longitude + "<br>";
  }
  targetDiv.innerHTML = reponseText;
  }
  // subscribe to the topic '/yahoo/geocode' to which this widget publishes events
  jmaki.subscribe("/yahoo/geocoder", geoCoderListener);
</script>

<div id="geocoder001_message"></div>                       Display location
                                                                              17
Geocoder’s
Component.html (hidden)
<div id="${uuid}">
<form
 onsubmit="jmaki.attributes.get('${uuid}').getCoordinates();
 return false;">
  Location: <input type="text" id="${uuid}_location">
  <input type="button" value="Get Coordinates"
  onclick="jmaki.attributes.get('${uuid}').getCoordinates();">
</form>
</div>

                                                          18
Geocoder’s
Component.js (hidden)
if (typeof jmaki.GeoCoder == 'undefined'){

 jmaki.GeoCoder = function(_widget) {
  var topic = "/yahoo/geocoder";

  var uuid = _widget.uuid;
  var service = _widget.service;
  if (typeof widget.args != 'undefined' &&
     typeof widget.args.topic != 'undefined') {
        topic = widget.args.topic;             uses default
   }                                           parameters


                                                              19
Geocoder’s
Component.js (hidden)
var location;
this.getCoordinates = function() {       Wrapped function
   location =
   encodeURIComponent(document.getElementById(uuid +
   "_location").value);

  var encodedLocation = encodeURIComponent("location=" +
  location);

  var url = service + "?key=yahoogeocoder&urlparams=" +
  encodedLocation;

  jmaki.doAjax({url: url, callback: function(req) { var _req=req;
  postProcess(_req);}});

 }                                                                  20
Componet.js (hidden)
function postProcess(req) {
    if (req.readyState == 4) {
       if (req.status == 200) {
          var response = eval("(" + req.responseText + ")");
          jmaki.publish(topic, response.coordinates);
       }
    }                                               Publish
  }                                                 response
}
}

var geocoder = new jmaki.GeoCoder(widget);

// add to the instance map for later refernece
jmaki.attributes.put(widget.uuid, geocoder);
                                                               21
References
 https://ajax.dev.java.net/
 https://ajax.dev.java.net/download.html
 http://javaserver.org/jmaki/
 http://www.netbeans.org/
 http://java.sun.com/javaee/javaserverfaces
  /ajax/tutorial.jsp
 http://www.javapassion.com/handsonlabs/ajaxj
  makiintro/
 http://www.google.com/apis/maps/
                                             22

More Related Content

What's hot

CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2Geoffrey Fox
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsCarol McDonald
 
Java Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVCJava Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVCIMC Institute
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJini Lee
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedIMC Institute
 
Java Web Programming [2/9] : Servlet Basic
Java Web Programming [2/9] : Servlet BasicJava Web Programming [2/9] : Servlet Basic
Java Web Programming [2/9] : Servlet BasicIMC Institute
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXIMC Institute
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 javatwo2011
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutesglassfish
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Michał Orman
 
Writing Gadgets with the WSO2 Gadget Server
Writing Gadgets with the WSO2 Gadget ServerWriting Gadgets with the WSO2 Gadget Server
Writing Gadgets with the WSO2 Gadget ServerWSO2
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)Daniel Bryant
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdkfirenze-gtug
 
Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVCGuy Nir
 

What's hot (19)

CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Java Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVCJava Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVC
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet Advanced
 
Java Web Programming [2/9] : Servlet Basic
Java Web Programming [2/9] : Servlet BasicJava Web Programming [2/9] : Servlet Basic
Java Web Programming [2/9] : Servlet Basic
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 
Spring 4 Web App
Spring 4 Web AppSpring 4 Web App
Spring 4 Web App
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
 
Backbone js-slides
Backbone js-slidesBackbone js-slides
Backbone js-slides
 
Writing Gadgets with the WSO2 Gadget Server
Writing Gadgets with the WSO2 Gadget ServerWriting Gadgets with the WSO2 Gadget Server
Writing Gadgets with the WSO2 Gadget Server
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
 
Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVC
 

Viewers also liked

M A N I A C A L T E N D E N C I E S D R S H R I N I W A S K A S H A L I K...
M A N I A C A L  T E N D E N C I E S  D R  S H R I N I W A S  K A S H A L I K...M A N I A C A L  T E N D E N C I E S  D R  S H R I N I W A S  K A S H A L I K...
M A N I A C A L T E N D E N C I E S D R S H R I N I W A S K A S H A L I K...drsolapurkar
 
Studi di settore. Periodo d'imposta 2006
Studi di settore. Periodo d'imposta 2006Studi di settore. Periodo d'imposta 2006
Studi di settore. Periodo d'imposta 2006gianlkr
 
Java代码编写的30条建议
Java代码编写的30条建议Java代码编写的30条建议
Java代码编写的30条建议yiditushe
 
Making your consortium sustainable: advocacy and communication
Making your consortium sustainable: advocacy and communicationMaking your consortium sustainable: advocacy and communication
Making your consortium sustainable: advocacy and communicationKristīne Pabērza
 
USC Gerentology Certificate
USC Gerentology CertificateUSC Gerentology Certificate
USC Gerentology CertificateWALTER SCHLOMANN
 
Devfest 09 Building Wave Robots
Devfest 09 Building Wave RobotsDevfest 09 Building Wave Robots
Devfest 09 Building Wave RobotsChris Schalk
 
selection_linkage_tutorial
selection_linkage_tutorialselection_linkage_tutorial
selection_linkage_tutorialtutorialsruby
 
Blossom With Stress Management Dr Shriniwas Kashalikar
Blossom With Stress Management  Dr Shriniwas KashalikarBlossom With Stress Management  Dr Shriniwas Kashalikar
Blossom With Stress Management Dr Shriniwas Kashalikardrsolapurkar
 
Professional Development opportunities 2010 New Zealand
Professional Development opportunities 2010 New ZealandProfessional Development opportunities 2010 New Zealand
Professional Development opportunities 2010 New ZealandLearning Network NZ
 
Pencils of Promise
Pencils of PromisePencils of Promise
Pencils of PromiseLisa Torres
 
T H E F E T T E R S A N D T H E F R E E D O M Dr
T H E  F E T T E R S  A N D  T H E  F R E E D O M  DrT H E  F E T T E R S  A N D  T H E  F R E E D O M  Dr
T H E F E T T E R S A N D T H E F R E E D O M Drdrsolapurkar
 
Dress Up Day
Dress Up DayDress Up Day
Dress Up Dayluhtalac
 

Viewers also liked (18)

hw1a
hw1ahw1a
hw1a
 
fms9_cwp_php_en
fms9_cwp_php_enfms9_cwp_php_en
fms9_cwp_php_en
 
M A N I A C A L T E N D E N C I E S D R S H R I N I W A S K A S H A L I K...
M A N I A C A L  T E N D E N C I E S  D R  S H R I N I W A S  K A S H A L I K...M A N I A C A L  T E N D E N C I E S  D R  S H R I N I W A S  K A S H A L I K...
M A N I A C A L T E N D E N C I E S D R S H R I N I W A S K A S H A L I K...
 
Studi di settore. Periodo d'imposta 2006
Studi di settore. Periodo d'imposta 2006Studi di settore. Periodo d'imposta 2006
Studi di settore. Periodo d'imposta 2006
 
Java代码编写的30条建议
Java代码编写的30条建议Java代码编写的30条建议
Java代码编写的30条建议
 
Making your consortium sustainable: advocacy and communication
Making your consortium sustainable: advocacy and communicationMaking your consortium sustainable: advocacy and communication
Making your consortium sustainable: advocacy and communication
 
USC Gerentology Certificate
USC Gerentology CertificateUSC Gerentology Certificate
USC Gerentology Certificate
 
dr_1
dr_1dr_1
dr_1
 
Devfest 09 Building Wave Robots
Devfest 09 Building Wave RobotsDevfest 09 Building Wave Robots
Devfest 09 Building Wave Robots
 
Intro
IntroIntro
Intro
 
P
PP
P
 
selection_linkage_tutorial
selection_linkage_tutorialselection_linkage_tutorial
selection_linkage_tutorial
 
Blossom With Stress Management Dr Shriniwas Kashalikar
Blossom With Stress Management  Dr Shriniwas KashalikarBlossom With Stress Management  Dr Shriniwas Kashalikar
Blossom With Stress Management Dr Shriniwas Kashalikar
 
Professional Development opportunities 2010 New Zealand
Professional Development opportunities 2010 New ZealandProfessional Development opportunities 2010 New Zealand
Professional Development opportunities 2010 New Zealand
 
Pencils of Promise
Pencils of PromisePencils of Promise
Pencils of Promise
 
Question 2
Question 2Question 2
Question 2
 
T H E F E T T E R S A N D T H E F R E E D O M Dr
T H E  F E T T E R S  A N D  T H E  F R E E D O M  DrT H E  F E T T E R S  A N D  T H E  F R E E D O M  Dr
T H E F E T T E R S A N D T H E F R E E D O M Dr
 
Dress Up Day
Dress Up DayDress Up Day
Dress Up Day
 

Similar to netbeans

GDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJSGDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJSPratik Majumdar
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorialKat Roque
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationAndrew Rota
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Hamed Hatami
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajaxs_pradeep
 
Intro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptIntro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptjasonsich
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.jsRody Middelkoop
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 

Similar to netbeans (20)

Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
 
GDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJSGDSC NITS Presents Kickstart into ReactJS
GDSC NITS Presents Kickstart into ReactJS
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorial
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajax
 
Jquery
JqueryJquery
Jquery
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
 
Intro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptIntro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScript
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
JSF2
JSF2JSF2
JSF2
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
 
Ajax
AjaxAjax
Ajax
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 

More from tutorialsruby

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

More from tutorialsruby (20)

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Recently uploaded

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging 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.pptxKatpro Technologies
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
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
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
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
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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...
 
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
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

netbeans

  • 1. JSF and AJAX with Netbeans 5.5 Wanasanan Thongsongkrit (NAS) :)
  • 2. AJAX 2
  • 3. AJAX’s shortcoming  Because AJAX is new, it has very inconsistent support among browsers.  Also, to develop with AJAX, you need to have some knowledge of JavaScript, which is out of reach for many page authors. 3
  • 4. Learning AJAX  Fast (easy) if you  Slow (hard) if you  are a JavaScript guru  come from a mostly static  have memorized the entire HTML/CSS background DOM API  are comfortable with  own and study books on traditional web application DHTML, JavaScript, CSS, architectures built around AJAX and useful hacks for an HTTP POST each technology  primary use of JavaScript is cut-and-paste of cute animations and other cool in-page behaviors 4
  • 5. AJAX toolkits  The complete list indicates some 160 toolkits exist  Keith provided a pointer to a popularity survey of AJAX toolkits (as of September 23, 2006)  Prototype (48%)  Script.aculo.us (33%)  Dojo (19%)  DWR (12%)  Moo.fx (11%)  jQuery (7%)  Rico (5%)  Yahoo UI (5%)  Atlas (4%)  MochiKit (4%)  XAjAX (4%)  GWT (3%) 5
  • 6. How to avoid learning javascript and all toolkits?  Use components that encapsulate AJAX inside  Benefits  Hide functionality behind simple building blocks  Page author do not have to write all java scripts themselves but let the component do the complicated work  Page authors have an easier time maintaining their pages  Reusable components  Technology used: Java Server Faces (JSF)  author can just drag and drop the components onto a page using a tool such as Sun Java Studio Creator or the NetBeans IDE. 6
  • 7. Create Great-Looking GUIs With NetBeans IDE 5.5 7
  • 9. jMaki Framework (plug-in)  JavaScript Wrapper framework for the Java platform  wraps popular AJAX frameworks into a JSP or JSF tag  Provides a common programming model to developers  Familiar to Java EE application developers  Leverages the widgets from popular frameworks (See) Dojo Flickr Google Scriptaculus Mochikit Spry Yahoo DHTML  What you need is: jMaki Plug-in https://ajax.dev.java.net/files/documents/3115/41646/ org-netbeans-modules-sun-jmaki.nbm 9
  • 10. Basic jMaki <a:ajax name="jmaki.delicious"/> Application Structure jmaki.js  the JavaScript bootstrapper and utilities that manages • the loading of jMaki widgets on the client, • makes XMLHttpRequests, • loads additional resources, • provides inter-widget communication using publish and subscribe • stores widget instances to be shared across an application. config.json  configuration of 10 3rd party libraries used by jMaki
  • 11. jMaki:  made up of JavaScript Runtime, the Server Side Runtime, and the XmlHttpProxy. 11
  • 12. JavaScript Runtime (jmaki.js)  responsible for  bootstrapping all widgets and passing parameters provided by a server-side runtime.  makes sure that each widget instance gets the correct parameters that were passed from the server-side runtime.  uses default parameters (if not provided) that may then be customized for each widget.  provides convenient APIs for performing an XMLHttpRequest and loading resources based on JSON with Padding (JSONP).  provides APIs for a widget to load extra scripts, styles, and resources needed by a widget.  provides a publish subscribe mechanism for widget-based communication.  provides a common namespace to store and access widgets The key point of the API is that you can program to 12 one API and access widgets from any given toolkit.
  • 13. Server-Side Runtime  responsible for  applying changes and rendering HTML templates.  renders all script and CSS references based on which type is centrally configured.  responsible for serializing parameters (specified as attributes in a JSP or JSF tag) that are passed to the JavaScript runtime.  capable of mapping widget values back into server- based model data, such as managed objects, web services, or databases. 13
  • 14. XmlHttpProxy  provides a generic JSON-based access to a widget range of XML-based services using an HTTP client.  services include RSS feeds, Yahoo services such as geocoding, Flickr image searches, and many more to come.  allows widgets to access services in a uniform way by providing XSL-to-JSON transformations that can be easily customized. 14
  • 15. How author configure widgets’ parameters via jMaki?  using JSON jMaki Widget JSON (parameters) wrapped Widget 15
  • 16. Using Your Own Data With a jMaki Widget  to add your own data to a widget (JSON format):  Using a static file  Using a JavaServer Faces managed bean  Using a JSP page or a servlet 16
  • 17. Demo: Publish and Subscribe Mechanism with Yahoo Geocoder <a:ajax name="yahoo.geocoder" service="/xhp"/> widget <script type="text/javascript"> Subscribe function geoCoderListener(coordinates) { var targetDiv = document.getElementById("geocoder001_message"); var reponseText = ""; for (var i in coordinates) { reponseText += "Latitude=" + coordinates[i].latitude + " Longitude=" + coordinates[i].longitude + "<br>"; } targetDiv.innerHTML = reponseText; } // subscribe to the topic '/yahoo/geocode' to which this widget publishes events jmaki.subscribe("/yahoo/geocoder", geoCoderListener); </script> <div id="geocoder001_message"></div> Display location 17
  • 18. Geocoder’s Component.html (hidden) <div id="${uuid}"> <form onsubmit="jmaki.attributes.get('${uuid}').getCoordinates(); return false;"> Location: <input type="text" id="${uuid}_location"> <input type="button" value="Get Coordinates" onclick="jmaki.attributes.get('${uuid}').getCoordinates();"> </form> </div> 18
  • 19. Geocoder’s Component.js (hidden) if (typeof jmaki.GeoCoder == 'undefined'){ jmaki.GeoCoder = function(_widget) { var topic = "/yahoo/geocoder"; var uuid = _widget.uuid; var service = _widget.service; if (typeof widget.args != 'undefined' && typeof widget.args.topic != 'undefined') { topic = widget.args.topic; uses default } parameters 19
  • 20. Geocoder’s Component.js (hidden) var location; this.getCoordinates = function() { Wrapped function location = encodeURIComponent(document.getElementById(uuid + "_location").value); var encodedLocation = encodeURIComponent("location=" + location); var url = service + "?key=yahoogeocoder&urlparams=" + encodedLocation; jmaki.doAjax({url: url, callback: function(req) { var _req=req; postProcess(_req);}}); } 20
  • 21. Componet.js (hidden) function postProcess(req) { if (req.readyState == 4) { if (req.status == 200) { var response = eval("(" + req.responseText + ")"); jmaki.publish(topic, response.coordinates); } } Publish } response } } var geocoder = new jmaki.GeoCoder(widget); // add to the instance map for later refernece jmaki.attributes.put(widget.uuid, geocoder); 21
  • 22. References  https://ajax.dev.java.net/  https://ajax.dev.java.net/download.html  http://javaserver.org/jmaki/  http://www.netbeans.org/  http://java.sun.com/javaee/javaserverfaces /ajax/tutorial.jsp  http://www.javapassion.com/handsonlabs/ajaxj makiintro/  http://www.google.com/apis/maps/ 22