简体   繁体   中英

Struts2 Ajax validation won't work

I decided to use Struts 2 DOJO plugin for the ajax validation of my forms.

I have:

  • Added Struts2 dojo and json plugin to project
  • Added ' jsonValidationWorkflowStack ' intercepter to my actions
  • Included dojo taglib and <sx:head /> tag on my page
  • Included <sx:submit validate="true" /> in my form

Now, after populating fields my form will not submit. No action will be performed.

I would also like to mention that I run my validation programatically, instead of xml.

DOJO plugin is deprecated.

To make it work, however, you would need to set the ajax theme in struts.xml, or in <sx:head /> , but this theme is deprecated too, and not even shipped anymore in the Struts2 jar.

Use Struts2-jQuery plugin validation instead.

Also when talking about client-side validation, reading this might help .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM