• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jyothi Sree
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you deploy the DWR library?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic