【问题标题】:Using tuckey, remove all query string paramerers from the url when a particular parameter exists使用 tukey,当存在特定参数时,从 url 中删除所有查询字符串参数
【发布时间】:2014-06-13 19:26:43
【问题描述】:

我刚刚被介绍给 tuckey,并且正在尝试在 pentaho 服务器(春季)中重写 url 查询参数。

我正在尝试做的事情: 重写

http://hostname:8080/pentaho/api/repos/:public:Steel%20Wheels:Regional%20Sales%20%28dashboard%29.xdash/viewer?token=ABC-1234-42rheRFrhewu2425-ticket&username=popcorn

http://hostname:8080/pentaho/api/repos/:public:Steel%20Wheels:Regional%20Sales%20%28dashboard%29.xdash/viewer

对我不起作用的事情:

<rule>
    <from>^/viewer$</from>
    <to type="redirect" last="true">/viewer</to>
</rule>

<rule>
    <condition type="parameter" name="token" operator="equal">(*)</condition>
    <from>^/viewer$</from>
    <to type="permanent-redirect" last="true">viewer</to>
</rule>

和许多变体。还检查了旧帖子。我知道我可能对正则表达式做错了,或者配置完全关闭。任何指针表示赞赏。

【问题讨论】:

    标签: spring tomcat spring-mvc url-rewriting tuckey-urlrewrite-filter


    【解决方案1】:

    完全忘记了这个问题,因为没有人回答。回答自己,以防有人发现自己处于相同的位置。

    <rule>
        <condition type="parameter" name="token" operator="equal">(*)</condition>
        <from>^/viewer(.*)$</from>
        <to type="permanent-redirect" last="true">viewer</to>
    </rule>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-16
      • 2018-04-20
      • 1970-01-01
      • 2022-01-22
      • 2021-03-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多