Package org.springmodules.validation.web.servlet.mvc

Examples of org.springmodules.validation.web.servlet.mvc.BaseCommandController


    public void postHandle(HttpServletRequest request,
                           HttpServletResponse response,
                           Object handler,
                           ModelAndView modelAndView) throws Exception {

        BaseCommandController controller = retrieveBaseCommandControllerIfPossible(handler);
        if (controller == null) {
          if (logger.isDebugEnabled()) {
            logger.debug("Controller is of type " + controller.getClass() + " so ignoring");
          }
          return;
        }
       
        Map model = modelAndView.getModel();
        String commandName = controller.getCommandName();
        if (model == null || !model.containsKey(commandName)) {
            if (logger.isWarnEnabled()) {
                logger.debug("Handler '" + handler + "' did not export command object '" + controller.getCommandName()
                    + "'; no rules added to model");
            }
            return;
        }

        Validator[] validators = controller.getValidators();
        for (int i=0; i<validators.length; i++) {
            if (!ValangValidator.class.isInstance(validators[i])) {
                continue;
            }
View Full Code Here


     * @return a <code>BaseCommandController</code> or <code>null</code> if <code>handler</code>
     *        cannot be converted.
     * @throws Exception
     */
  private BaseCommandController retrieveBaseCommandControllerIfPossible(Object handler) throws Exception {
    BaseCommandController baseCommandController = null;
   
    if (BaseCommandController.class.isAssignableFrom(handler.getClass())) {
      if (logger.isDebugEnabled()) {
        logger.debug("handler is type compatible, simply cast");
      }
View Full Code Here

TOP

Related Classes of org.springmodules.validation.web.servlet.mvc.BaseCommandController

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.