【问题标题】:how can I refresh in angular using jboss 6.4?如何使用 jboss 6.4 刷新角度?
【发布时间】:2020-01-02 12:59:25
【问题描述】:

我已经在子系统标签中以这种方式配置了standalone.xml文件:

<rewrite name="rule-2" pattern="^((?!.*(rest)).*)\/([\w\-]+)\/([\w\-]+)$" substitution="/$1/index.html" flags="L"/>      
        <rewrite name="rule-3" pattern="^((?!.*(rest)).*)\/([\w\-]+)$" substitution="/$1/index.html" flags="L"/>

我应该将所有 url 重定向到索引,让包含“rest”一词的那些通过,我认为这些正则表达式必须工作,但我得到一个空白页面来刷新而没有错误。 我已经像这样设置了base-href:/myApp/

使用这两种正则表达式替代方案:

rewrite name="rule-1" pattern="^/(.*)/([\w\-]+)/([\w\-]+)$" substitution="/$1/index.html" flags="L"/>      
        <rewrite name="rule-2" pattern="^/(.*)/([\w\-]+)$" substitution="/$1/index.html" flags="L"/>

一切正常,但所有包含“rest”一词的 URL 也会被重定向,因此后端调用不起作用

【问题讨论】:

    标签: angular jboss angular6 jboss6.x


    【解决方案1】:

    首先: 要验证您的正则表达式模式,请使用工具,例如。 https://regex101.com

    第二: 在第一条规则中,被排除在外:!.*(rest)) 因此,您还需要添加排除项或条件。

    Jboss web 应用规则的cli命令:

    #/subsystem=web/virtual-server=default-host/rewrite=jboss:add(pattern="^/$", substitution="/example/", flags="L,R=302")
    

    第三: 关于刷新,对于 JBoss 中的任何属性,您必须使用 CLI 命令重新加载服务器

    :重新加载

    希望有帮助

    【讨论】:

      猜你喜欢
      • 2019-02-18
      • 1970-01-01
      • 2014-11-06
      • 2016-05-05
      • 2021-07-08
      • 1970-01-01
      • 2013-12-15
      • 2018-01-18
      • 2014-03-08
      相关资源
      最近更新 更多