<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Spikes Of Nothingness - jpublishdwr tag</title>
  <link>http://weblog.flop.ca/tags/jpublishdwr/</link>
  <description>Florin T.PATRASCU&#039;s blog</description>
  <language>en</language>
  <copyright>Florin T.PATRASCU</copyright>
  <lastBuildDate>Sat, 12 May 2012 02:12:08 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>JPublish and AJAX are finally happy together! DWR rulezzzz</title>
    <link>http://weblog.flop.ca/2007/04/28/1177793787559.html</link>
    
      
        <description>
          &lt;font size=&#034;3&#034; style=&#034;font-family: Verdana;&#034;&gt;Today I am very happy to announce that JPublish works beautifully with one of the best AJAX frameworks: &lt;a href=&#034;http://getahead.org/dwr&#034;&gt;DWR2.0&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
DWR 2.0, a great milestone, a great achievement, congratulations to the DWR team.&lt;br /&gt;
&lt;br /&gt;
Integrating JPublish with DWR was &lt;a href=&#034;http://en.wikipedia.org/wiki/The_Long_and_Winding_Road&#034;&gt;a long and winding road&lt;/a&gt; but I don&#039;t regret a second of development. It was also a nice game of expectation during the few releases of DWR, with every release I had to tweak something in my code or implement something new. It was challenging to see which will be &lt;a href=&#034;http://getahead.org/blog/joe/&#034;&gt;Joe&lt;/a&gt;&#039;s next move and then tune my existing code for the new DWR release. &lt;br /&gt;
&lt;br /&gt;
Because I started to integrate DWR when 2.0 was just a baby ;) I had to tweak, change and even to scrap completely my code until DWR RC2 came out. DWR support lists are a great help, highly recommended to any new DWR user.&lt;br /&gt;
&lt;br /&gt;
Even though DWR2.0 is &lt;a href=&#034;http://getahead.org/blog/joe/2007/04/26/dwr_version_2_0_released.html&#034;&gt;very fresh&lt;/a&gt; and there is already a roadmap for 2.1 ;) I do believe that my simple integration is stable and can be used.&lt;br /&gt;
&lt;br /&gt;
To be able to test my code, I followed DWR&#039;s examples and here they are in action as JPublish-2 citizens :) &lt;a href=&#034;http://jpublishdwr.flop.ca&#034;&gt;JPublishDWR.flop.ca&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As soon as I&#039;ll migrate my SVN repositories to a &lt;a href=&#034;http://code.google.com/p/jpublish/&#034;&gt;better place&lt;/a&gt; I&#039;ll open the access to the JPublishDWR sources including the related projects I also maintain, one of them being a refactored and very stable JPublish (2.0.12) &lt;font style=&#034;font-style: italic;&#034;&gt;(included in the examples)&lt;/font&gt;.&lt;br /&gt;
&lt;br /&gt;
If you want to use it and have a look at the current integration, please download the &lt;a href=&#034;http://weblog.flop.ca/files/jpublishdwr-demo.zip&#034;&gt;archive&lt;/a&gt; containing the JPublishDWR and all the required libraries (including the new JPublish2x).&lt;br /&gt;
&lt;br /&gt;
For those of you already familiar with JPublish, to enable DWR in a JPublish application is extremely simple.&lt;br /&gt;
&lt;br /&gt;
- modify your jpublish.xml file and include this snippet: &lt;br /&gt;
&lt;font color=&#034;#000080&#034;&gt;&lt;br style=&#034;background-color: rgb(255, 255, 255);&#034; /&gt;
&lt;/font&gt; &lt;font size=&#034;2&#034; color=&#034;#000080&#034; style=&#034;background-color: rgb(255, 255, 255);&#034;&gt;&amp;lt;module classname=&amp;quot;ca.flop.jpublish.dwr.DWRModule&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dwr-config-file&amp;gt;/WEB-INF/dwr-test.xml&amp;lt;/dwr-config-file&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dwr-path-prefix&amp;gt;/dwr&amp;lt;/dwr-path-prefix&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dwr-servlet-parameters&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activeReverseAjaxEnabled&amp;gt;true&amp;lt;/activeReverseAjaxEnabled&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;debug&amp;gt;false&amp;lt;/debug&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dwr-servlet-parameters&amp;gt;&lt;br /&gt;
&amp;lt;/module&amp;gt;&lt;br /&gt;
&lt;/font&gt;&lt;font size=&#034;2&#034; color=&#034;#339966&#034;&gt;&lt;br /&gt;
&lt;/font&gt; - be sure you have the JPublishDWR-2.0.jar in your application&#039;s WEB-INF/lib folder&lt;br /&gt;
- start coding DWR AJAX.&lt;br /&gt;
&lt;br /&gt;
By looking at the examples in the attached archive you&#039;ll learn easily to enable AJAX in your JPublish applications, here are few hints:&lt;br /&gt;
&lt;br /&gt;
- in a template add the following key ingredients:&lt;br /&gt;
&lt;/font&gt;&lt;br style=&#034;background-color: rgb(204, 255, 255);&#034; /&gt;
&lt;font size=&#034;2&#034; color=&#034;#000080&#034;&gt; &amp;lt;script type=&#039;text/javascript&#039;&amp;nbsp; src=&#039;$request.ContextPath/dwr/engine.js&#039;&amp;gt;&amp;lt;/script&amp;gt;&lt;br style=&#034;background-color: rgb(204, 255, 255);&#034; /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;nbsp; src=&#039;$request.ContextPath/dwr/util.js&#039;&amp;gt;&amp;lt;/script&amp;gt;&lt;br style=&#034;background-color: rgb(204, 255, 255);&#034; /&gt;
&lt;/font&gt; &lt;font size=&#034;3&#034; style=&#034;font-family: Verdana;&#034;&gt;&lt;br /&gt;
- then in a page where you would like to use DWR, I am gonna use here one of the DWR examples (the &lt;em&gt;asmg &lt;/em&gt;example), publish your java objects that you would like to use, in this case: &lt;strong&gt;Generator &lt;/strong&gt;and &lt;strong&gt;EmailValidator&lt;/strong&gt;&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;font size=&#034;2&#034; color=&#034;#000080&#034;&gt; &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;nbsp; src=&#039;$request.ContextPath/dwr/interface/Generator.js&#039;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&#039;$request.ContextPath/dwr/interface/EmailValidator.js&#039;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;/font&gt; &lt;br /&gt;
&lt;font size=&#034;3&#034; style=&#034;font-family: Verdana;&#034;&gt;- now you can easily use these objects:&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;font size=&#034;2&#034; color=&#034;#000080&#034;&gt; &amp;lt;td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;input type=text id=&amp;quot;address&amp;quot; onkeypress=&amp;quot;DWRUtil.onReturn(event, process)&amp;quot; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onblur=&amp;quot;verifyAddress()&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;/font&gt; &lt;font size=&#034;3&#034; style=&#034;font-family: Verdana;&#034;&gt;&lt;font size=&#034;2&#034; color=&#034;#000080&#034;&gt;&lt;br /&gt;
&lt;/font&gt; &lt;br /&gt;
To see the JPublish DWR&#039;s own asmg example follow this link: &lt;a href=&#034;http://jpublishdwr.flop.ca/asmg&#034;&gt;asmg&lt;/a&gt;, neat eh? :)&lt;br /&gt;
&lt;br /&gt;
Next? Moving my SVN, implementing a super nice DWRAction for JPublish to allow you to invoke JPublish Actions through DWR, writing some DOCS and more JPublish specific examples, opening the sources for the JPublishDWR module, and more :)&lt;br /&gt;
&lt;br /&gt;
Let me know if you&#039;re interested to use this implementation and I&#039;ll be glad to assist you.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
-florin&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;/font&gt;
&lt;p style=&#034;font-family: Verdana;&#034;&gt;  &lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://weblog.flop.ca/2007/04/28/1177793787559.html#comments</comments>
    <guid isPermaLink="true">http://weblog.flop.ca/2007/04/28/1177793787559.html</guid>
    <pubDate>Sat, 28 Apr 2007 20:56:27 GMT</pubDate>
  </item>
  
  </channel>
</rss>

