GeeCON Prague 2014*
The moose likes Struts and the fly likes Unable to apply DWR Ajax feature to the jsp page in struts2 application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to apply DWR Ajax feature to the jsp page in struts2 application" Watch "Unable to apply DWR Ajax feature to the jsp page in struts2 application" New topic
Author

Unable to apply DWR Ajax feature to the jsp page in struts2 application

Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
Hi

I am trying to apply ajax DWR to my form feilds in struts2 ..
I have made the changes in the application ..

1) Added the library struts2-dwr-plugin-2.1.6.jar in the Lib folder.

2) Added the following Servlet mapping in the web.xml .
<servlet>
<servlet-name>dwr</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>

3) Added the dwr.xml file .

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

<dwr>
<allow>
<create creator="new" javascript="validator">
<param name="class" value="org.apache.struts2.validators.DWRValidator"/>
</create>
<convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/>
</allow>

<signatures>
<![CDATA[
import java.util.Map;
import org.apache.struts2.validators.DWRValidator;
DWRValidator.doPost(String, String, Map<String, String>); ]]>
</signatures>
</dwr>

4) In the jsp page in the Form added onblur="validate(this);" for each field ..

but i am not getting the ajax effect ...

What else more i need to do .............


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Did you deploy the DWR library?
 
GeeCON Prague 2014
 
subject: Unable to apply DWR Ajax feature to the jsp page in struts2 application