Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring中使用注释的包装类_Spring_Controller_Annotations_Base - Fatal编程技术网

Spring中使用注释的包装类

Spring中使用注释的包装类,spring,controller,annotations,base,Spring,Controller,Annotations,Base,如果我使用注释,是否可以在Spring中使用一个基类包装所有控制器?基本上,在显示HTML之前,我需要在所有页面上进行一些检查,还包括一些配置,如网站的BASE_URL等 我知道我可以使用Spring安全性来验证用户及其登录状态/权限以查看页面,但我还需要根据他们的权限级别等设置变量。那么,有没有一种方法可以让每个页面都有一个基本设置,而不必在每个方法中添加相同的代码呢?我可以使用AOP或者(更符合Spring MVC),a,这是Spring与servlet过滤器的类似物。看一看,我一生都无法在

如果我使用注释,是否可以在Spring中使用一个基类包装所有控制器?基本上,在显示HTML之前,我需要在所有页面上进行一些检查,还包括一些配置,如网站的BASE_URL等


我知道我可以使用Spring安全性来验证用户及其登录状态/权限以查看页面,但我还需要根据他们的权限级别等设置变量。那么,有没有一种方法可以让每个页面都有一个基本设置,而不必在每个方法中添加相同的代码呢?

我可以使用AOP或者(更符合Spring MVC),a,这是Spring与servlet过滤器的类似物。

看一看,我一生都无法在工作之前获得@。有没有其他可能的解决方案,不需要做这么多的工作来做一些看似简单的事情?