gpt4 book ai didi

jsp - 将 SSL 用于部署在 IBM-WASCE 上的应用程序

转载 作者:太空宇宙 更新时间:2023-11-03 15:07:46 28 4
gpt4 key购买 nike

我有一个使用 JSP 和 Servlet 并部署在 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.xml for web app default/foo/1.0/car includes security elements but Geronimo deployment plan is not provided or does not contain element necessary to configure security accordingly.

如何从这里开始?将哪些元素添加到文件 geronimo-web.xml

最佳答案

[已解决]

必须在文件 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>

关于jsp - 将 SSL 用于部署在 IBM-WASCE 上的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1854955/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com