- - PR -
tomcat5 での、で、役割ごとに制限したい。
1
投稿者 | 投稿内容 | ||||
---|---|---|---|---|---|
|
投稿日時: 2005-01-07 20:25
tomcat でweb.xmlの内容を以下のように記述しました。
<security-constraint> <web-resource-collection> <web-resource-name>Basic Authenitication test1</web-resource-name> <url-pattern>/jsp/secret/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>userdata</role-name> </auth-constraint> </security-constraint> <security-role> <role-name>userdata</role-name> </security-role> <security-constraint> <web-resource-collection> <web-resource-name>Basic Authenitication test2</web-resource-name> <url-pattern>/jsp/master/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>master</role-name> </auth-constraint> </security-constraint> <security-role> <role-name>master</role-name> </security-role> <login-config> <auth-method>BASIC</auth-method> <realm-name>会員認証</realm-name> </login-config> やろうとしてるのは、BASIC認証で、2個ではなく1個ならちゃんと認証できます。 masterとuserdataのロールで入れるjspを分けたいと思っています。 JDBCレルムでデータベースとの接続は確認済みです。 なんかわかる方がいればお願いします。 環境 tomcat5.0.16 MySQL4.0.16 j2sdk1.4.2.03 | ||||
|
投稿日時: 2005-01-08 21:54
security-constraintを2つ続けて書いて、その後にsecurity-roleを2つ続けて書いてみてはいかがでしょうか。
ちなみに、web-app_2_3.dtdは次の通りです。
|
1