Questions tagged [url-mapping]

A framework's URL mapping facility is the mechanism by which the framework interprets URLs.

The frameworks match the provided URLs against pre-determined patterns using regular expressions, or use URL rewriting to translate the provided URL into one that the underlying engine will recognize. Another technique is that of graph traversal, where a URL is decomposed in steps that traverse an object graph (of models and views).

A URL mapping system that uses pattern matching or URL rewriting allows more "SEO friendly URLs" to be used, increasing the simplicity of the site and allowing for better indexing by search engines. This makes the URL easier for people to read and hand write, and provides search engines with better information about the structural layout of the site. A graph traversal approach also tends to result in the creation of SEO friendly URLs.

363 questions
5
votes
0 answers

how to define Grails url mappings with optional parameters not at end of url

I can only find examples of Grails url mappings with optional parameters at the end of the url; however, I need to define optional parameters followed by a required suffix which is not a file extension. e.g. /a?/b?/c which would match all of the…
5
votes
2 answers

grails - subdomain based projects and links

I am trying to develop a grails application that has "root" content (www.mydomain.com/about for example) but will also support "projects" based upon the subdomain of the request; for example myproject.mydomain.com > www.mydomain.com/myproject. As a…
Rich Kroll
  • 3,995
  • 3
  • 23
  • 28
5
votes
3 answers

How to exclude specific keywords from UrlMapping in Grails?

I use the following url mapping in Grails: "/$id"{ controller = "user" action = "show" } to map urls like mydomain.com/someusername How do I attach constrains to the url mapping to exclude keywords like "login", "logout",... I.e.,…
Michael
  • 32,527
  • 49
  • 210
  • 370
5
votes
2 answers

Grails 2.2.0 URLMappings: Any way to use same URL with Different Verb

I have the following: "/api/users"(controller: "user") { action = [GET:"list"] } Doing a call to http://localhost:8080/platform/users I get a list of users back. Then I added this: "/api/users"(controller: "user") { action =…
Gregg
  • 34,973
  • 19
  • 109
  • 214
5
votes
3 answers

Spring Controller's URL request mapping not working as expected

I have created a mapping in web.xml something like this: dispatcher org.springframework.web.servlet.DispatcherServlet
Atharva
  • 6,711
  • 5
  • 31
  • 39
4
votes
1 answer

Grails UrlMappings with URL-pattern ending with "/"

I have the following UrlMapping in my Grails UrlMappings class: "/$something/" { controller = "controllerName" action = "actionName" constraints { } } Requests to both "/foobar/" and "/foobar" gets routed to the correct…
knorv
  • 49,059
  • 74
  • 210
  • 294
4
votes
1 answer

Grails urlmapping using id and name

hey all, i have a question about urlmapping in grails. I'm trying to make seo friendly url's using a page name and id. I got the follwing in my URLMapping: class UrlMappings { static mappings = { "/$id/$name"{ controller = "page" …
BadSkillz
  • 1,993
  • 19
  • 37
4
votes
1 answer

How to redirect from a controller using a named URL mapping?

I have a URL mapping as below: static mappings = { name register: "/register" { controller = "account" action = "createuser" } } and I want to redirect using this mapping from a controller with something…
fabien7474
  • 16,300
  • 22
  • 96
  • 124
4
votes
2 answers

How to ignore Spring Security config for every thing except a pattern

I have a rest webservice configured as a spring boot application. All my rest urls have a base path "/api/...". I am also serving static content from my application. I need to configure security ONLY for the web service i.e., URLs that start with…
David Nimmagadda
  • 83
  • 1
  • 1
  • 4
4
votes
2 answers

How do I map my domain URL the root folder of my Grails app?

I have a Grails app called abc, which when I access locally I get at through http://localhost:port/abc I have deployed my app up on Amazon EC2 with an elastic IP address which I can get at directly as http://1.2.3.4/abc I have a domain name of…
Simon
  • 78,655
  • 25
  • 88
  • 118
4
votes
1 answer

With grails, can I specify the controller, action, and view in UrlMappings.groovy?

With Grails, in UrlMappings.groovy, it seems I can specify the controller and action: "/someURL" (controller: "Some", action: "someAction") Or I can specify the view: "/someURL" (view: "someView") But I can't specify the controller, action, and…
drew
  • 2,949
  • 3
  • 25
  • 27
4
votes
2 answers

generic view url mapping in grails

I'm trying to do this: "/templates/$tml"{ view: "/templates/$tml" } and this: "/templates/$tml"{ view: "/templates/${tml}" } and this: "/templates/$tml"{ view: "/templates/${params.tml}" } But none of them…
Noampz
  • 1,185
  • 3
  • 11
  • 19
4
votes
2 answers

how to handle url that are not mapped in spring

My dispatcher servlet mapping dispatcher org.springframework.web.servlet.DispatcherServlet contextConfigLocation
user2779544
  • 429
  • 1
  • 8
  • 24
4
votes
2 answers

Get request URL from grails controller

My grails controller gets invoked by the following URLs /center/madrid/12-de-octubre /center/madrid/12-de-octubre?opt=1 I need the controller to behave differently if there are any parameters after the ? in the URL I have the following URL…
user3028981
  • 91
  • 1
  • 5
4
votes
0 answers

SpringMVC 3.0 to 3.1 migration of ControllerClassNameHandlerMapping

I have an existing application in Sping 3.0 that uses ControllerClassNameHandlerMapping to map Controller and methods such as: StartController.class is mapped to http://127.0.0.1/app/start/* then StartController.class has a method called init()…
Mick Knutson
  • 2,297
  • 3
  • 25
  • 48
1 2
3
24 25