Apache Struts 2 Documentation > Home > Overview > Whiteboard > AJAX Validation - points for discussion |
var validation = new ValidationServlet('/validationServlet/client.js'); validation.onErrors = function(inputObject, errors) { // clear old errors // display new errors }
class Errors { String[] actionErrors; Map<String, String[]> fieldErrors; // fieldName is the key }
/src/java/templates/xhtml/validation.vm /src/webapp/validationServlet.js /src/webapp/javascript-input.jsp
function addActionErrors(messages); // should messages be an array?! function addFieldErrors(fieldName, messages); // should messages be an array?! function clearActionErrors(); function clearFieldErrors(fieldName); function clearErrors(formName);