- PR -

tomcat5 での、で、役割ごとに制限したい。

1
投稿者投稿内容
初心者
会議室デビュー日: 2005/01/06
投稿数: 3
投稿日時: 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
matobaa
常連さん
会議室デビュー日: 2002/12/26
投稿数: 21
投稿日時: 2005-01-07 20:52
tomcatのログに SAXException とか出てませんか?

Eclipse + Xmen + XMLValidator な環境だと、赤いバッテンが付いてます。
Xmen:
http://sourceforge.net/projects/xmen/
XMLValidator:
http://sourceforge.net/tracker/index.php?func=detail&aid=1071052&group_id=58200&atid=486879

で、
<security-constraint />
<security-constraint />
<login-config />
<security-role />
<security-role />
という順番にしたら、赤いバッテンは消えました。
Tomcatでは動作させてないので、これでいいかはわかりませんけれど。

# 宣伝
るぱん
ぬし
会議室デビュー日: 2003/08/01
投稿数: 1370
投稿日時: 2005-01-07 23:15
DTDで縛られてるけど、縛りを無視している・・・ってことかな??

それはさておき。
っていうか、Exceptionの内容とか、
現状どうでこれからこういう風な期待値が欲しい・・・ぐらい書きましょうよ。

何故、それがおかしいと感じたのかとかあると判断しやすいですね。

現状では推測の域をでないので判断つきません。
1

スキルアップ/キャリアアップ(JOB@IT)