jboss设置系统首页&https&websocket

一、设置系统首页

1、修改jboss4/server/default/deploy/jboss-web.deployer/conf目录下web.xml,确保有welcom-file中有index.html就行

<error-page>  
    <error-code>503</error-code>  
     <location>/error/503.htm</location>  
</error-page>  
<error-page>  
    <error-code>404</error-code>  
    <location>/error/404.htm</location>
</error-page>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

2、/usr/local/jboss4/server/default/deploy/jboss-web.deployer/ROOT.war目录下添加index.html,

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>404 Not Found</title>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   <link rel="StyleSheet" href="jboss.css" type="text/css"/>
</head>

<body>
<script>
window.location.href=window.location.protocol+"//"+window.location.host+'/项目名/login.jsp';

</script>
</body>
</html>

如果只想显示域名body中使用iframe

注意:这种方式进行跳转会有refer,如果有refer检测的话注意添加refer路径

二、http强制转换https

jboss/server/default/deploy/jboss-web.deployer/conf下web.xml新增

<security-constraint>
        <web-resource-collection>
            <web-resource-name>HtmlAdaptor</web-resource-name>
            <description>
                An example security config that only allows users with
                the role JBossAdmin to access the HTML JMX console web
                application
            </description>
            <url-pattern>/</url-pattern>
            <!-- <http-method>GET</http-method>
                <http-method>POST</http-method> -->
        </web-resource-collection>
        <!--<auth-constraint>
            <role-name>JBossAdmin</role-name>
            </auth-constraint> -->
        <user-data-constraint>
            <description>Protection should be CONFIDENTIAL</description>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

三、https下websocket消息推送

websocket消息推送在http下使用ws://协议,https下使用wss://协议,如果使用jboss发布服务,Tomcat发布websocket,注意使用相同ssl证书,并且使用域名连接

猜你喜欢

转载自blog.csdn.net/myfmyfmyfmyf/article/details/105410753