Your SlideShare is downloading. ×
  • Like
  • Save

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

AjaxとFlashのDWRサンドイッチ、Springを添えて

  • 8,462 views
Published

JavaScriptからJavaをシームレスに呼び出せるAjaxフレームワーク「DWR」。バージョン2より強化されたSpringとの連携などについて紹介していきます

JavaScriptからJavaをシームレスに呼び出せるAjaxフレームワーク「DWR」。バージョン2より強化されたSpringとの連携などについて紹介していきます

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Thanks for creating this one: http://www.repossessedcarstore.com
    Are you sure you want to
    Your message goes here
  • i wish I know how to read Japanese!
    http://www.mindpowerspecialreport.com/
    http://www.myselfhypnosis.net/<br /><br/>
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
8,462
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
2
Likes
6

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 1 1
  • 2. 2 2 Web2.0 RIA Web2.0 Web Web
  • 3. 33 3 Web2.0 RIA Google
  • 4. 44 4 Web2.0 RIA flickr slideshare
  • 5. 55 5 Ajax DWR Spring DWR Tips
  • 6. 6 6 Ajax AJAX = “Asynchronous JavaScript and XML” XMLHttpRequest (XHR) XML Ajax = XHR + DHTML(HTML,CSS,JavaScript)
  • 7. 7 7 Ajax - Web HTTP Web GUI Database Server HTML, CSS ... Ajax Web HTTP Web Database GUIJavaScript (Event) engine Ajax Server HTTP JavaScript (DOM ) XML
  • 8. 8 8 Ajax XMLHttpRequest
  • 9. 99 9 Ajax var xhr; // XMLHttpRequest Mozila : var xhr = new XMLHttpRequest(); IE : var xhr = new ActiveXObject(“Microsoft.XMLHTTP”); xhr.open(“GET”, “/data.xml”); // xhr.onreadystatechange = function() { // if( xhr.readyState == 4 && xhr.status == 200 ) { // xhr.responseText } } xhr.send(null); //
  • 10. 10 Ajax IE 5, IE 5.5, IE 6 XHR ActiveX Firefox, Safari 1.2~, Opera 8~, IE 7 DOM
  • 11. 11 DWR
  • 12. 12 DWR DWR = “Direct Web Remoting” JavaScript Java Apache Software License v2 Java JavaScript JavaScript Java
  • 13. 13 DWR - http://getahead.org/dwr/overview/dwr
  • 14. 14 DWR - HTTP Creator Java DWR Converter Manager Servlet JavaScript Converter dwr.xml
  • 15. 15 DWR dwr.jar GUI (HTML, CSS, JavaScript) JavaScript Java dwr.xml DWR web.xml
  • 16. 16 DWR Java dwr.jar WEB-INF/lib DWR web.xml dwr dwr.xml JavaScript JavaBeans Java
  • 17. 17 17 DWR HTML DWR JS dwr.engine, dwr.util DWR Java JavaScript JavaScript DWR Java
  • 18. 18 DWR DEMO
  • 19. 19 DWR Ajax Framework
  • 20. 20 DWR Walmart
  • 21. 21 21 DWR monstar.fm
  • 22. 22 Spring
  • 23. 23 DWR Spring Spring JavaScript Spring POJO Spring Bean DWR Spring AOP Filter Acegi Security Transaction
  • 24. 24 DWR dwr.xml Spring Creator <dwr> <allow> <create creator=“spring” javascript=“MyService”> <param name=“beanName” value=“myService” /> </create> </allow> </dwr>
  • 25. 25 DWR Spring bean dwr:remote dwr2.0 dwr Bean
  • 26. 26 DWR web.xml dwr servlet DwrSpringServlet <servlet> <servlet-name>dwr</servlet-name> <servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet- class> </servlet> bean dwr:remote <bean id=“myService” class=“sample.MyService”> <dwr:remote javascript=“MyService"></dwr:remote> </bean>
  • 27. 27 27 Web DEMO
  • 28. 28 DWR Tips
  • 29. 29 Callback callback errorHandler var handler = { callback : function( data ) { }, errorHandler : function( reason ) { alert(“Message : “ + reason); } }; MyService.method( arg, handler );
  • 30. 30 Exception Converter <convert converter="null" match="java.lang.StackTraceElement" /> <convert converter="exception" match=“sample.MyException" /> var handler = { callback : function() {}, errorHandler : function( reason, ex ) { if ( ex.javaClassName == “sample.MyException” ) { } }}
  • 31. 31 DWREngine.beginBatch(); // DWREngine.endBatch();
  • 32. 32 Ajax DWR Ajax Java Spring
  • 33. 33 Q&A