Jsp LDAP与Tomcat7
这对任何人都有效吗?我在网上找到了一本又一本指南,但似乎什么都不起作用 我已将以下内容添加到我的/manager/web.inf中Jsp LDAP与Tomcat7,jsp,tomcat,active-directory,Jsp,Tomcat,Active Directory,这对任何人都有效吗?我在网上找到了一本又一本指南,但似乎什么都不起作用 我已将以下内容添加到我的/manager/web.inf中 <security-constraint> <display-name>your web app display name</display-name> <web-resource-collection> <web-resource-name>Protected Are
<security-constraint>
<display-name>your web app display name</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.html</url-pattern>
<url-pattern>*.xml</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Users</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>your role description</description>
<role-name>Users</role-name>
</security-role>
404错误
以下是我能在日志中找到的唯一相关内容:
Mar 18, 2014 10:13:28 AM org.apache.catalina.core.StandardHostValve custom
FINE: Processing ErrorPage[errorCode=404, location=/WEB-INF/jsp/404.jsp]
根据您的问题标题,我猜您希望在Tomcat管理器上设置LDAP身份验证 您不应为了保护manager而修改manager web app。在JavaEE中,安全约束是应用程序的规则,与容器管理的身份验证非常不同
适当的解决方案是配置容器使用的身份验证策略,这是一个纯tomcat conf。在conf/server.xml中,使用适当的身份验证策略(例如LDAP身份验证)替换为运行管理器的引擎定义的默认值。您只需为安装指定适当的属性。请注意,默认的conf是指一个使用conf/tomcat-users.xml文件的全局资源。我必须在下面添加到web.xml文件中
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>JNDIRealm</realm-name>
</login-config>
您添加到经理的web.xml中的内容与LDAP有什么关系?等等,是web.inf还是web.xml?
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>JNDIRealm</realm-name>
</login-config>