Showing posts with label DWR. Show all posts
Showing posts with label DWR. Show all posts

Tuesday, January 3, 2017

Cross domain security error dwr

You can avoid security checking in client side in dwr by adding following code into web.xml file

<servlet>
<servlet-name>dwr-invoker</servlet-name>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
        <init-param>
           <param-name>debug</param-name>
           <param-value>false</param-value>
        </init-param>
        <init-param>
           <param-name>accessLogLevel</param-name>
          <param-value>EXCEPTION</param-value>
        </init-param>
        <init-param>
          <param-name>crossDomainSessionSecurity</param-name>
          <param-value>false</param-value>
        </init-param>
</servlet>

Tuesday, January 24, 2012

dwr mapping filter

<filter>
<filter-name>dwrFilter</filter-name>
<filter-class>org.directwebremoting.servlet.DwrWebContextFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>dwrFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>



This filter can be used to redirect request for DWR servlet.

Friday, August 7, 2009

How to log exceptions in dwr?

Add the following jar files to your project library.

commons-logging-1.1.1.jar
commons-logging-adapters-1.1.1.jar
commons-logging-api-1.1.1.jar
commons-logging-tests.jar
commons-logging-1.1.1-javadoc.jar
commons-logging-1.1.1-sources.jar
dwr.jar

Tuesday, December 16, 2008

Ajax + Dwr

Dwr is a framework for Ajax developers. It is easy to use.

Refer the site for more

<blockquote>http://directwebremoting.org/</blockquote>

Dwr Xml

---------

<blockquote><?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 0.4//EN" "http://www.getahead.ltd.uk/dwr/dwr.dtd">

<dwr>

<allow>

<create creator="new" javascript="ViewDataJS">

<param name="class" value="com.hylafax.view.ViewData"/>

</create>

<convert converter="bean"

match="com.hylafax.sent.SentDetail"/>

</allow>

</dwr></blockquote>

in dwr xml, create tag creates a new js object of a java class. here "ViewData" java class has been converted to a "ViewDataJS" js script.

convert tag is used to convert object types to js. here "SentDetail" java class objects are converted.

In your jsps

---------------

<blockquote><script type='text/javascript'

src='/Project/dwr/interface/ViewData.js'></script>

<script type='text/javascript'

src='/Project/dwr/engine.js'></script></blockquote>

you have to add dwr jar file to your project. after that you can call your js methods which are in your java class.

you can access your script urls by typing :

http://localhost:8080/Test/dwr

here Test is your project



calling methods in java class

------------------------------

you can call methods like this



ViewDataJS.getReceiveList(division,gotBReceivedFax);

here "division" is the prameter for the getReceiveList method. you can get the results with gotBReceivedFax method.