Questions tagged [urlmappings.groovy]

The URLMappings plugin configures Grails' URL Mapping infrastructure.

The URLMappings plugin configures Grails' URL Mapping infrastructure.

34 questions
7
votes
3 answers

UrlMappings to point a URL to an asset pipeline file in Grails

In Grails 3.0 how do you map a URL to a file under the assets folder? For example: http://localhost:8080/favicon.ico --> grails-app/assets/images/bookmark.ico I've tried a few test mappings, such as: grails-app/controllers/UrlMappings.groovy class…
4
votes
1 answer

Generic URLMapping in Grails for all 4xx or 5xx Errors

I am using Grails 2.4.4 and would like to define a generic UrlMapping for a range of HTTP-error-codes (like 450-499, 510-540). I've found some related questions - even on SO - but the answers are either outdated or not working. The container does…
Christopher Will
  • 2,991
  • 3
  • 29
  • 46
3
votes
1 answer

How to detect Fragment identifiers in Url Mappings?

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…
Mark Rogers
  • 96,497
  • 18
  • 85
  • 138
2
votes
1 answer

Grails: how to set a parameter for the whole group in UrlMappings

Our Grails 2.5 web application has REST API. We need to start a new version of the API so a group was created in UrlMappings.groovy like this: group ("/v2") { "/documents"(resources: 'document') { "/meta"(resource: 'documentInfo', includes:…
matejk
  • 798
  • 1
  • 14
  • 27
2
votes
0 answers

Can I trigger Grails url mappings before Interceptors execute?

I have a Grails 3.1.3 app with the following setup: class UrlMappings { static mappings = { "/error"(controller: 'error', action: 'error') "/$controller/$action?/$id?"() "/"(controller: "index", action:…
mwersch
  • 105
  • 7
2
votes
3 answers

ERROR mapping.DefaultUrlMappingEvaluator$UrlMappingBuilder - URL mapping argument [exception] with value [(*)] must be a valid class

I am having this error in my grails log: Error | ERROR mapping.DefaultUrlMappingEvaluator$UrlMappingBuilder - URL mapping argument [exception] with value [(*)] must be a valid class It is not stopping the application, but I would like to know why…
GSAN
  • 648
  • 6
  • 29
1
vote
2 answers

Grails URL mapping cause error on GSP

I have a site that have URL similar to this: /mysite/admin/controller/action/id /mysite/search/controller/action/id /mysite/user/controller/action/id I have my URL mapping like this "/$prefix/$controller/$action?/$id?"{ constraints {} } I am…
Churk
  • 4,556
  • 5
  • 22
  • 37
1
vote
2 answers

What's the best way to save scaffolding for developer access?

I'm working on a project in Grails 2.0.RC1 and I'd like to be able to save the scaffolded controllers and views for my domain objects to have as a "low-level", developer only access to still tinker with things while being able to develop the…
Todd
  • 1,822
  • 15
  • 18
1
vote
2 answers

How does one escape the # sign in a Url pattern in UrlMappings.groovy?

In order to maintain the current set of Urls in a project, I have to be able to use the # (pound sign) in the Url. For some reason the pound sign does not appear to work normally in this project for UrlMappings.groovy. Is there a special…
Mark Rogers
  • 96,497
  • 18
  • 85
  • 138
1
vote
1 answer

Grails: encrypt query params, use hashing to encrypt/decrypt the params in url and hidden fields

I'm working on grails app. When do get request (to show one entity for example) the id of that entity will be shown in the url in browser For security issues, I'm trying to encrypt the id in the url. any idea how I can hashing the id/or any params…
1
vote
1 answer

How to disable default URL mappings for some actions

I'm using Grails version 3.1.12. I want to disable some default URL mappings for actions in order to manage them manually. For example, given the controller: class MyController { myAction() { render('Hello') } } This action maps by…
1
vote
1 answer

URL Mapping - Replacing characters in a parameter pulled from a database

I am currently trying to figure out, how to modify the parameter being integrated into the URL Mapping I am using. static mappings = { "/$controller/$action?/$id?/(.$format)?" { constraints { // apply constraints here …
Nimmi
  • 11
  • 3
1
vote
0 answers

Grails 2.5.0 UrlMappings with two consecutive slashes

I have inherited a Grails 2.2.4 UrlMappings (partially reproduced below) that I am trying to upgrade to 2.5.0. Named mappings api0 & api2 work, but the two consecutive slashes in api1 (between $controller & $id) do not seem to be matched properly in…
XDR
  • 4,070
  • 3
  • 30
  • 54
1
vote
1 answer

Grails URL id field not getting mapped to params

Here is my URLmappings.groovy class UrlMappings { static mappings = { "/$controller/$action?/$id?(.${format})?" { constraints { // apply constraints here } } "/ewhet/$id"(controller : "ewhet", action :…
rahulserver
  • 10,411
  • 24
  • 90
  • 164
1
vote
1 answer

Parametric action names in grails urlMappings

I am trying to map a JSON api to my controller like: /api/user/1/location GET --> Controller.getLocation() /api/user/1/location POST --> Controller.setLocation() I have tried the following url mapping rule without any luck: …
Bahadır Yağan
  • 5,577
  • 3
  • 35
  • 39
1
2 3