Register / Login
Win a copy of
Cross-Platform Desktop Applications: Using Node, Electron, and NW.js
this week in the
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
struts2: howto ajax-validate with annotation?
posted 9 years ago
does anyone have an example of ajax-validation with annotation?
I'm trying to achieve the following: I have a form with:
Name/e-mail are mandatory fields. Right now, if the user clicks Update and everything goes well - a Success Message is shown in the target ID.
If the user doesn't provide the Name - An error message is shown: "Update Fail"
Problem is that in my output, in case of a failure, there is no indication of the required field (what is the problem).
So my question is this: how can I tell which of the fields is missing?
* I'm using annotation in my form
configuration: <result name="input">/pages/registration/error.jsp</result> <result name="confirm-ajax">/pages/registration/confirm.jsp</result> error.jsp <%@ taglib prefix="s" uri="/struts-tags" %> <% request.setAttribute("decorator", "none"); response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server Update Fail! %>
It is sorta covered in the
JavaRanch Style Guide
Boost this thread!
Caching is not working
not able to catch exceptions from jsp page
"Edit in Place" Using Simple JS
S2: caching problem,-user clicks on a link and then back w/ broweser data is lost
struts2 with ajax: howto return a value to div?