【发布时间】:2012-08-05 06:17:45
【问题描述】:
我目前正在使用旧版 Spring 2.5 应用程序,我想做的是修改自定义控制器(扩展 SimpleFormController)的验证逻辑。
protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors) throws Exception;
我想在这个方法中做的是根据我提供的服务类的结果编写一个 cookie。但是,由于此时在控制器的工作流程中我无权访问HttpServletResponse 对象,有没有其他方法可以:
- 检索
HttpServletResponse对象以向其写入cookie。或者。 - 使用 Spring MVC 中的一些其他工具来生成 cookie。我查看了
org.springframework.web.util.CookieGenerator,但它仍然需要响应对象才能工作。
感谢任何人提供的帮助。
感谢您的宝贵时间!
【问题讨论】:
标签: servlets cookies spring-mvc