如何检测Url映射中的片段标识符?

编程入门 行业动态 更新时间:2024-10-23 11:21:01
本文介绍了如何检测Url映射中的片段标识符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在项目中,我试图根据是否存在 片段标识符 存在于Url中。片段标识符很重要,因为Flash库 SWFAddress 使用它们与Flash中的应用程序进行通信网页。

我只需要确定请求url中是否存在片段。

我应该看看 HttpServletRequest 做到这一点?

Grails中根据片段标识符是否是路由URL的最佳方式是目前在Url?

[我问过在Grails论坛上的这个同样的问题。]

解决方案

片段标识符不是URL的一部分,它仅与URL一起使用。它只对客户有价值。

兼容的服务器将忽略客户端发送的任何片段标识符。

你不能根据片段标识符设计你的url映射,URL到达你的应用程序时不会包含片段标识符。

In a Grails project I'm trying to map a Url based on whether or not a Fragment Identifier is present in the Url. The Fragment Identifiers are important because a Flash library SWFAddress uses them to communicate to a Flash application present in the web page.

I simply need to determine whether a fragment is present or not in the Request url.

Should I look into HttpServletRequest to do this?

What's the best way in Grails to route a url based on whether a Fragment Identifier is present in a Url?

[I asked this same question at the Grails forum.]

解决方案

A fragment identifier is not part of a URL, it is merely used in conjunction with a URL. It is of value only to the client.

A compliant server will ignore any fragment identifier sent by a client.

You can't design your url mappings based on fragment identifiers, the URL will not contain a fragment identifier by the time it reaches your app.

更多推荐

如何检测Url映射中的片段标识符?

本文发布于:2023-10-12 23:27:05,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标识符   片段   Url

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!