Wie können Sie "HTTPS umleiten" Arbeit auf dem WebSphere Application Server Liberty Profile?

Ich will HTTP-Redirect arbeiten, die auf dem WebSphere Application Server Liberty Profile (WLP). Zum Beispiel:-

Wenn der Benutzer die Typen:
http://localhost:8080/helloworld der browser sollte automatisch gehen (werden weitergeleitet)
https://localhost:9443/helloworld

Um dies zu erreichen, folgte ich diesem Dokument, Abschnitt 6.2, Seite keine. 136.

Unten ist die Probe server.xml und web.xml:-

server.xml

<server description="new server">

<!-- Enable features -->
<featureManager>
    <feature>jsp-2.2</feature>
    <feature>wab-1.0</feature>
    <feature>jaxrs-1.1</feature>
    <feature>blueprint-1.0</feature>
    <feature>localConnector-1.0</feature>
    <feature>ssl-1.0</feature>
    <feature>appSecurity-2.0</feature>
</featureManager>

<httpEndpoint host="localhost" httpPort="8081" httpsPort="9442" id="defaultHttpEndpoint">
</httpEndpoint>

<applicationMonitor updateTrigger="mbean"/>
<keyStore id="defaultKeyStore" password="{xor}Lz4sLCgwLTtu"/>

<application id="Hello.app" location="Hello.app.eba" name="Hello.app" type="eba"/>

web.xml

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

    <security-constraint>
        <display-name>HTTPS Redirect Security Constraint</display-name>
        <web-resource-collection>
            <web-resource-name>Sample Web Service service</web-resource-name>
            <url-pattern>/Hello</url-pattern>
            <http-method>GET</http-method>

        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
</web-app>

Entfernt <servlet> und <servlet-mapping> tag für die Kürze.

Unten sind die Versionen, die ich benutze:-
Java 7, WLP 8.5.5, Eclipse Juno, Google Chrome.

Jede Hilfe, Richtlinien auf, warum HTTPS redirect wird nicht die Arbeit wird sehr geschätzt.

InformationsquelleAutor Anuroop | 2013-07-03

Schreibe einen Kommentar