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
2
votes
1 answer

Grails UrlMappings with parameter values containing "."

Given this UrlMapping: "/foo/$foobar" { controller = "foo" action = "foo" constraints { } } Combined with this controller: class FooController { def foo = { def foobar = params.foobar println "foobar=" + foobar …
knorv
  • 49,059
  • 74
  • 210
  • 294
2
votes
2 answers

Gerneric url mapping for restful resources in grails

I have configured some restful resources in grails like this "/book/$id?"(resource:"book") "/author/$id?"(resource:"author") But I want to to this more generic like "/$controller/$id?"(resource: controller) which doesn't work... (getting 404) How…
aveltens
  • 323
  • 2
  • 10
2
votes
1 answer

Where does my "urls.py" file go in my Django project?

I'm using Django and Python 3.7. I used PyCharm to create a project and it created the following directory structure (some of the custom additions are my own): mainpage __init__.py __pycache__ admin.py apps.py fixtures …
Dave
  • 15,639
  • 133
  • 442
  • 830
2
votes
1 answer

Spring 3.0 URL Mapping Issues

I'm testing an upgrade from Spring 2.0 to Spring 3.0.5 on Tomcat and am having an issue where there is different mapping behavior for URLs that have a trailing slash versus an identical URL without the trailing slash. For example, in my Spring 2.0…
peltzdude
  • 21
  • 1
2
votes
4 answers

How to prevent direct access to *.gsp pages in Grails

Could anyone advise a feasible solution to prevent direct access to *.gsp pages on Grails? After reviewing intercepting '/**.gsp', I found it is impossible to use that as it not only filters out direct access, but also the pages rendering from…
tom.au
  • 21
  • 1
  • 3
2
votes
2 answers

Grails UrlMapping 404

I have this: static mappings = { "/a/b/$id/stuff"(controller: "stuff", action "action1" ) "/a/b/$id/stuff/$stuffId"(controller: "stuff", action "action2" ) "/a/b/$id/stuff/$stuffId/c"(controller: "stuff", action "action3" ) } I can hit…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
2
votes
1 answer

Launching a grails-app through Intelli-J with root set to localhost:8080/ instead of localhost:8080/app, or modifying createLink?

Is there a way to launch an application through Intelli-J so that it makes localhost:8080/ the root of the application? The problem I'm having is that AJAX urls that work locally don't work in production, and createLink(action:"ajaxUpdate") seems to…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
2
votes
1 answer

url-mapping for all .html URLs, including URLs with query parameters

I'm trying to write a filter that will pick out any request for an HTML page, regardless of whether or not the URL has query parameters. (The aim of this filter is to track visitor actions/stats) This is filter mapping I have in my…
ampersandre
  • 3,156
  • 3
  • 29
  • 37
2
votes
1 answer

Servlet/JSP URLs when forwarding requests

My web app has a servlet called admin which when navigated to checks if the user is logged in and if the are directs to the the admin section, but if they aren't it directs them to a JSP page with a sign-in form. The name of the JSP doesn't appear…
Deano
  • 1,740
  • 4
  • 20
  • 24
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
2 answers

Rewriting URL for the default action in controllers

I'm having trouble rewriting URL's in Grails: I've got 2 controllers BlogController and ProjectsController each with a default def index = { } and matching view. Now when I create the following links: Blog
Jasper
  • 2,166
  • 4
  • 30
  • 50
2
votes
0 answers

how to exclude url mapping in filterRegistrationBean in spring mvc?

I have Spring 4.0 application that does not use web.xml. I have the following webApplicationIntializer in the spring project. public class MyWebAppInitializer implements WebApplicationInitializer { public static final String MAPPING_URL =…
brain storm
  • 30,124
  • 69
  • 225
  • 393
2
votes
0 answers

Grails URL Mappings using name for multiple adress

I'm looking for good practice or a shorter way to write my "Named" Grails URL mapping. I'd like to write (especially to ease the internationalization process) this in UrlMappings.groovy: name…
Smithfield
  • 341
  • 4
  • 11
2
votes
1 answer

URL name keeps appending to end Django

I am running into a few issues regarding URL mappings in Django. I have the following code: table.html:
steveclark
  • 537
  • 9
  • 27