java 获取锚点,我怎样才能读取java servlet中的html锚点?

I need to get all parameters from the request including what comes after "#".

example:

request: http://myserver/m#q=abc

I need my server to get all parameters after "#" as they where after "?"

How can i do that?

10x,

Koby

解决方案

Anchors or URL fragments as they are referred to in RFC 1738, are not sent by the client to the server, when requesting for a resource. The rationale is that fragment URLs are utilized to identify a location within a resource and not a different resource on the server. In order to identify the location in the resource, the client needs to fetch the complete resource from the server, and this process need not involve transfer of information about the fragment (as it does not mean anything to the server).

If you do wish to submit information via the query string using a URL containing a fragment, you will have to ensure that the querystring precedes the URL fragment. This might be a bug in your client-side code, if you're constructing the request on your own. Leave the request construction logic to the browser, if you can afford to do so.

If you do wish to send the fragment character (#) to the server, then you'll need to encode it in the query string, or the client(browser) will simply ignore that section of the URL when it sends the request to the server.

Related Questions on SO

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值