Spring mvc request.isUserInRole()在SpringMVC中不起作用
我有一个SpringMVC应用程序。我使用的是weblogic基本用户身份验证,我在weblogic服务器上创建了一个用户角色,并将用户添加到该角色中。 用户可以登录到应用程序,应用程序输入控制器类的默认方法。在这个方法中,我有以下逻辑来检查用户是否存在于不工作的组中。它应该满足if条件,但它去了elseSpring 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
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>
集团经理
请帮忙