Доброго времени суток. Изучаю jaas на примере jaasbook. Разбираю пример взаимодействия jaas c tomcat.
При запуске tomcat выдает такое предупреждение: WARNING: A docBase D:\Java\apache-tomcat-6.0.29\webapps\jaas-web inside the host appBase has been specified, and will be ignored
web.xml
| Код | <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>jaas</display-name> <description>JAAS</description> <servlet> <servlet-name>InitServlet</servlet-name> <servlet-class>auth.StartupServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> <welcome-file-list> <welcome-file>/web/index.jsp</welcome-file> </welcome-file-list>
<error-page> <error-code>403</error-code> <location>/web/access-denied.jsp</location> </error-page>
<taglib> <taglib-uri>auth-tags</taglib-uri> <taglib-location>/WEB-INF/auth-tags.tld</taglib-location> </taglib>
<security-constraint> <web-resource-collection> <web-resource-name>Admin Page (Chp09)</web-resource-name> <url-pattern>/web/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> </security-constraint>
<security-constraint> <web-resource-collection> <web-resource-name>Customer Page (Chp09)</web-resource-name> <url-pattern>/web/customer/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>customer</role-name> </auth-constraint> </security-constraint>
<login-config> <auth-method>FORM</auth-method> <realm-name>Chp09 Realm</realm-name> <form-login-config> <form-login-page>/web/login.jsp</form-login-page> <form-error-page>/web/login-error.jsp</form-error-page> </form-login-config> </login-config> <security-role> <description> Role required to see admin pages. </description> <role-name>admin</role-name> </security-role>
<security-role> <description> Role required to see customer pages. </description> <role-name>customer</role-name> </security-role>
</web-app>
|
и context.xml в папке META-INF в папке проетка:
| Код | <Context path="/jaas_web" docBase="D:\Java\apache-tomcat-6.0.29\webapps\jaas-web" debug="0" reloadable="true"> <Realm className="org.apache.catalina.realm.JAASRealm" appName="jaas-web" userClassNames="auth.UserPrincipal" roleClassNames="auth.UserGroupPrincipal" useContextClassLoader="false" /> </Context>
|
Как правильно прописать docBase ? |