0

JSP とサーブレットを使用し、IBM-WASCE 2.1 にデプロイされたアプリケーションがあります。アプリケーションでログインに SSL を使用する必要があります。ドキュメントに基づいて、次の行をweb.xmlに追加しました

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

        <!-- Usual servlet mapping code -->

  <security-constraint>
        <web-resource-collection>
            <web-resource-name>Login</web-resource-name>
            <url-pattern>/login.jsp</url-pattern>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

ただし、次のようなエラーが表示されます。

Web アプリ default/foo/1.0/car の web.xml にはセキュリティー要素が含まれていますが、Geronimo デプロイメント・プランが提供されていないか、それに応じてセキュリティーを構成するために必要な要素が含まれていません。

ここからどのように進めますか?ファイルgeronimo-web.xmlに追加する要素は?

4

1 に答える 1

0

【解決済み】

ファイル geronimo-web.xml で以下の変更を行う必要がありました。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
  <sys:environment>
    <sys:moduleId>
      ...
           <!-- Basic stuff -->
      ...
    </sys:moduleId>


  </sys:environment>
  <context-root>/foo</context-root>

  <security-realm-name>geronimo-admin</security-realm-name>
    <security>
        <default-principal>
            <principal name="anonymous" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
            />
        </default-principal>
        <role-mappings>
            <role role-name="admin">
                <principal name="administrators" designated-run-as="true" 
                class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"         
                />
                <principal name="root"
class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
                />
            </role>
        </role-mappings>
    </security>
</web-app>
于 2010-03-16T19:12:53.273 に答える