3

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.]

Mark Rogers
  • 96,497
  • 18
  • 85
  • 138
  • 1
    This Stack Overflow question is relevant: [How to get the request url from HttpServletRequest?](http://stackoverflow.com/questions/2860718/how-to-get-the-request-url-from-httpservletrequest) and the Wikipedia article on the [Fragment Identifier](http://en.wikipedia.org/wiki/Fragment_identifier). In short - the fragment identifier is only dealt with client-side. – jennyfofenny Apr 28 '11 at 04:08

1 Answers1

2

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.

Jon Cram
  • 16,609
  • 24
  • 76
  • 107