package es.internna.testing.dwr;
import es.internna.framework.annotations.AutowireToController;
import es.internna.framework.annotations.Bean;
import es.internna.framework.annotations.UrlMapping;
import es.internna.framework.spring.mvc.AbstractRequestHandler;
import es.internna.framework.spring.mvc.validation.SystemValidator;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
@UrlMapping("validate.action")
@AutowireToController(controllerBean="multiActionController")
public class Action extends AbstractRequestHandler
{
private Log log = LogFactory.getLog(Action.class);
private SystemValidator systemValidator;
public void setSystemValidator(SystemValidator systemValidator)
{
this.systemValidator = systemValidator;
}
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception
{
AnnotatedTrivialObject to = new AnnotatedTrivialObject();
to.setAnInteger(1000);
Errors errors = systemValidator.validateObject(to);
log.info(errors);
return new ModelAndView("end");
}
}