Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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 mvc request.isUserInRole()在SpringMVC中不起作用_Spring Mvc_Jakarta Ee_Weblogic11g - Fatal编程技术网

Spring mvc request.isUserInRole()在SpringMVC中不起作用

Spring mvc request.isUserInRole()在SpringMVC中不起作用,spring-mvc,jakarta-ee,weblogic11g,Spring Mvc,Jakarta Ee,Weblogic11g,我有一个SpringMVC应用程序。我使用的是weblogic基本用户身份验证,我在weblogic服务器上创建了一个用户角色,并将用户添加到该角色中。 用户可以登录到应用程序,应用程序输入控制器类的默认方法。在这个方法中,我有以下逻辑来检查用户是否存在于不工作的组中。它应该满足if条件,但它去了else if(request.isUserInRole("GROUP_MANAGER")) { // do something }else { // d

我有一个SpringMVC应用程序。我使用的是weblogic基本用户身份验证,我在weblogic服务器上创建了一个用户角色,并将用户添加到该角色中。 用户可以登录到应用程序,应用程序输入控制器类的默认方法。在这个方法中,我有以下逻辑来检查用户是否存在于不工作的组中。它应该满足if条件,但它去了else

 if(request.isUserInRole("GROUP_MANAGER"))
  {
        // do something

  }else
  {
        // do something
  }
My web.xml具有以下特性

     <security-constraint>
 <web-resource-collection>
    <web-resource-name>App</web-resource-name>
    <url-pattern>/*</url-pattern>     
  </web-resource-collection>
  <auth-constraint> 
    <role-name>GROUP_MANAGER</role-name> 
  </auth-constraint>
  <user-data-constraint>
  <transport-guarantee>NONE</transport-guarantee>
 </user-data-constraint>
 </security-constraint>  

  <security-role>
    <role-name>GROUP_MANAGER</role-name>
  </security-role>
     <wls:security-role-assignment>
        <wls:role-name>GROUP_MANAGER</wls:role-name>
        <wls:externally-defined/>
</wls:security-role-assignment>

应用程序
/*     
集团经理
没有一个
集团经理
My weblogic.xml具有以下特性

     <security-constraint>
 <web-resource-collection>
    <web-resource-name>App</web-resource-name>
    <url-pattern>/*</url-pattern>     
  </web-resource-collection>
  <auth-constraint> 
    <role-name>GROUP_MANAGER</role-name> 
  </auth-constraint>
  <user-data-constraint>
  <transport-guarantee>NONE</transport-guarantee>
 </user-data-constraint>
 </security-constraint>  

  <security-role>
    <role-name>GROUP_MANAGER</role-name>
  </security-role>
     <wls:security-role-assignment>
        <wls:role-name>GROUP_MANAGER</wls:role-name>
        <wls:externally-defined/>
</wls:security-role-assignment>

集团经理
请帮忙