在Android中使用路径preFIX [英] Using path prefix in Android

查看:193
本文介绍了在Android中使用路径preFIX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的网址:


  • https://a.com/myapp/test.html

  • https://c.com/myapp/test1.html

  • https://a.com/myapp/test.html
  • https://c.com/myapp/test1.html

该URL的主机可以改变,但路径preFIX将保持不变,例如的myapp <​​/ STRONG>,因为它是在上下文根我的web应用程序的

The host of the url can change but the path prefix will remain constant like myapp as it is the context root of my web app.

所以,我希望我的过滤器,只能用 HTTPS HTTP 当路径$ p的计划承认$ PFIX为的myapp <​​/ STRONG>。我这样做,但我的应用程序响应所有这些具有方案的URL。

So i want my filter to only recognize with the schemes of https and http and when the path prefix is myapp. I did that but my application is responding to all the urls which are having the schemes.

如果将主机未提及的路径preFIX过滤器将无法工作的manifest.xml

Will the path prefix filter won't work if host is not mentioned in the manifest.xml ?

任何其他想法,我可以怎么我写我的意图过滤器对我的情况?

Any other ideas how i can i write my intent filter for my scenario ?

最好的问候,
Saurav

Best Regards, Saurav

推荐答案

我继续通过将主机=*,然后路径prefixing。

I went ahead by putting host="*" and then path prefixing.

这样,所有主机都会被匹配,但将由路径值被过滤掉。

This way all the hosts will be matched but will be filtered out by the path values.

让和我知道这是正确的做法,如果有可能会有一些更好的办法?

Let me know if this is the correct way or if there could be some better way ?

欢呼声,
Saurav

cheers, Saurav

这篇关于在Android中使用路径preFIX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆