Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Topics
History of dynamic web applications Web 2.0 and AJAX The DWR approach to AJAX Using Spring & DWR (by example) Best practices Tools and widgets DWR roadmap Conclusion
Web 2.0
The term "Web 2.0" refers to development of the World Wide Web, including its architecture and its applications. As used by its proponents, the phrase currently refers to one or more of the below : a transition of websites from isolated information silos to sources of content and functionality, thus becoming a computing platform serving web applications to end users a social phenomenon referring to an approach to creating and distributing Web content itself, characterised by open communication, decentralization of authority, freedom to share and reuse, and "the market as a conversation" a more organized and categorized content, with a more developed deeplinking web architecture. a shift in economic value of the web, potentially equalling that of the dot com boom of the late 1990s However, a consensus upon its exact meaning has not yet been reached. Skeptics argue that the term is essentially meaningless, or that it means whatever its proponents decide that they want it to mean in order to convince the media and investors that they are creating something fundamentally new, rather than continuing to develop and use well-established technologies. Many recently developed concepts and technologies are seen as contributing to Web 2.0, including weblogs, wikis, podcasts, rss feeds and other forms of many to many publishing; social software, web APIs, web standards, online web services, AJAX, and others.
What is AJAX?
AJAX Example
Google Suggest
AJAX
Not one technology, several technologies
XHTML and CSS Document Object Model (DOM) XML (and XSLT) XMLHttpRequest (XHR) JavaScript
AJAX - Issues
Browser incompatibilities
ActiveX in IE Native in Mozilla/Firefox
Back button and browser history Working with XML in JavaScript Accessibility
getInstance(AjaxHelper)
AjaxHelper.getData()
DWR Handler
getData()
Ajax Helper
Customer customer = new Customer(); customer.setFirstName(Joe); Address address = new Address(); address.setStreet( Collins Avenue); customer.setAddress(address); .
Security
All methods on exposed objects are exposed by default
Use include/exclude rules per method
Only objects are marshaled for which a converter is registered Role restrictions
Use security constraints on DWR paths Specify an auth constraint per creator (JAAS) Use Spring Security interceptors
DWR Utilities
Include the utility script
<script type="text/javascript" src="/dwr/util.js"></script>
Demo
DWR
DWR = AJAX with Spring made easy! Expose Spring-managed beans by means of JavaScript
Pros Reuse Spring MVC services (LocaleResolver, etcetera) No need to define a ContextLoaderListener Cons Need to use Spring MVC
Pros
No need for ContextLoaderListener or Spring MVC
Cons
Creates an application context for each creator
Use SpringCreator.setOverrideBeanFactory(BeanFactory) to create global application context for all spring creators
Demo
DWR & Spring
Avoid overuse
Use when appropriate
Tools
Widgets
DOJO Prototype Script.aculo.us And many, many others
Reverse AJAX
Send JavaScript to the browser
Demo
Spring integration
Conclusion
AJAX improves the user experience Avoid overuse DWR provides easy AJAX DWR integrates nicely with Spring Still more to come
Questions?