1. How do I know whether DWR is available on my Dekoh Desktop?

Dekoh Desktop Portal ships with DWR version 1.4 integrated. All applications that extend Dekoh Portal have the dwr.jar in their classpath.

2. How do I use DWR in my application?

If your application extends ekohportal, the required DWR jar already exists in the classpath. Include the following script tag in your JSP page to include your DWR specific js files.
<script src=”/dekohportal/dwr/engine.js”></script>
<script src=”/dekohportal/dwr/util.js”></script>
  1. In case you want to use application specific dwr calls, add a dwr servlet mapping in your application's web.xml file
 <servlet>
        <servlet-name>dwr-invoker</servlet-name>
        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
        <init-param>
            <param-name>config-<ObjectName></param-name>
            <param-value>dwr-mapping-xml-file-path</param-value>
        </init-param>
</servlet>
<servlet-mapping>
        <servlet-name>dwr-invoker</servlet-name>
        <url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
  1. You must also add a DWR method script, which maps to the dwr-file-name.xml file:
 <dwr>
    <allow>
        <create creator="new" javascript="<script-name>">
            <param name="class" value="class-to-expose-as-dwr"/>
            <include method="method-to-expose-as-script"/>           
        </create>
    </allow>
</dwr>
  1. Provide the above created file's relative path in your application web.xml file as an init param to the dwr servlet.

3. How do I use the DWR calls which are already available on Dekoh Portal?

  1. Use the following script tag in your JSP page to include DWR specific js files.
<script src=”/dekohportal/dwr/engine.js”></script>
<script src=”/dekohportal/dwr/util.js”></script>
  1. Use the raw DWR engine to access the dwr method on dekohportal.
DWREngine._execute(“/dekohportal/dwr, '<class-js-name>', '<method-name>', function(data){}, <parameters>);