WLP :: Change default context root on http

扶醉桌前 提交于 2019-12-02 01:48:22
ebullient

You can turn that page off by adding the following to your server.xml file:

<httpDispatcher enableWelcomePage="false" />

http://www-01.ibm.com/support/knowledgecenter/api/content/nl/en-us/SSRTLW_9.0.0/com.ibm.websphere.wlp.nd.multiplatform.doc/autodita/rwlp_metatype_4ic.html#mtFile119

edit:

I should clarify, the other answer is also correct. If you install an application with "/" as the context root, it will be used instead of the main page.

If you add something like the following to that application's web.xml:

<security-constraint>
    <display-name>Some constraint</display-name>
    <web-resource-collection>
        <web-resource-name>All</web-resource-name>
        <description>All URLs</description>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <description>All users</description>
        <role-name>User</role-name>
    </auth-constraint>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

You will get the https redirect that you're asking for.

Additional edit (per comment), the following is a more complete example of how to set up the redirect: How to make "HTTPS redirect" work on WebSphere Application Server Liberty Profile?

Gas

Just create your application and in the server.xml specify context root as follows:

<webApplication id="MyApp" location="MyApp.war" name="MyApp" contextRoot="/"/>

If you want to redirect to login page and ssl, then you will need to do all steps in the post you quoted and of course provide login page in your application.

If you want just to disable the welcome page, add to server.xml fragment provided by ebullient or even extend it by adding some javascript code which would make the redirect:

<httpDispatcher enableWelcomePage="false" appOrContextRootMissingMessage='&lt;script&gt;document.location.href="/MyApp/";&lt;/script&gt;'></httpDispatcher>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!