我有一个用控制器实例化的特殊实体。在请求期间,它应该被传递到处理程序的参数中:
@Controller
@Scope("session")
public class HomeController {
@Autowired
Context context; // this thing should be passed into request.
//context field from controller should be passed into request parameter
//in order to set request attributes properly.
//The instance of CommonRequest class should have reference to the context during
//mapping HTTP request into CommonRequest object.
@RequestMapping(value = "/do_smth", method = RequestMethod.POST)
public void doSmth(CommonRequest request) {
}
}
有没有办法做到这一点?