UrlMapping

View: New views
3 Messages — Rating Filter:   Alert me  

UrlMapping

by Robert Fischer-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey there.  Is there a piece of UrlMapping documentation I'm missing?  It looks like the urls fed
into the mapping strip off the file suffix.

The /js/application.js file, for instance, is traced through my UrlMapping config this way:
[25361] mapping.DefaultUrlMappingsHolder Attempting to match URI [/js/application] with pattern [500]
[25362] mapping.DefaultUrlMappingsHolder Attempting to match URI [/js/application] with pattern
[/(*).xml]
[25362] mapping.DefaultUrlMappingsHolder Attempting to match URI [/js/application] with pattern
[/search]
[25362] mapping.DefaultUrlMappingsHolder Attempting to match URI [/js/application] with pattern [/]
[25362] mapping.DefaultUrlMappingsHolder Attempting to match URI [/js/application] with pattern
[/(*)/id/(*)]
[25362] mapping.DefaultUrlMappingsHolder Attempting to match URI [/js/application] with pattern
[/(*)/(*)?/(*)?]
[25362] mapping.DefaultUrlMappingsHolder Matched URI [/js/application] with pattern
[/(*)/(*)?/(*)?], adding to posibilities

How do I get at the file suffix as part of the mappings (e.g. a constraint)?

I'd also like to handle .xml and .html files differently -- something akin to responds_to in Rails.

~~ Robert.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: UrlMapping

by Peter Ledbrook-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> How do I get at the file suffix as part of the mappings (e.g. a constraint)?
>
> I'd also like to handle .xml and .html files differently -- something akin to responds_to in Rails.

Look in the User Guide under "Content Negotiation". To get the file
extensions, you need to set this configuration option in
Config.groovy:

  grails.mime.file.extensions = false

Cheers,

Peter

--
Software Engineer
G2One, Inc.
http://www.g2one.com/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: UrlMapping

by Robert Fischer-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sweet.  Looks like I was just missing a part of the documentation.

Thanks for the help.

~~ Robert.

Peter Ledbrook wrote:

>> How do I get at the file suffix as part of the mappings (e.g. a constraint)?
>>
>> I'd also like to handle .xml and .html files differently -- something akin to responds_to in Rails.
>
> Look in the User Guide under "Content Negotiation". To get the file
> extensions, you need to set this configuration option in
> Config.groovy:
>
>   grails.mime.file.extensions = false
>
> Cheers,
>
> Peter
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email