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 Controller and URL Mapping Magic

Grails 3.0.1 here. I'm looking to accomplish a specific URL/controller structure. My app deploys at the root context (/), meaning locally it runs as http://localhost:8080, and non-locally as http://someserver.example.org. I want everything under…
smeeb
  • 27,777
  • 57
  • 250
  • 447
2
votes
1 answer

Servlet path info includes empty string

I have the following servlet: @WebServlet("/publication/topic/*") public class ViewTopicPublicationsServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) { String[] pathInfo =…
marknorkin
  • 3,904
  • 10
  • 46
  • 82
2
votes
0 answers

UriTemplate matching with optional trailing slash

I'm using the Spring Web UriTemplate for some URL matching. In the following example, the second assert fails because of the mismatched slash at the end of the URL: UriTemplate uriTemplate = new UriTemplate("/myservice/{version}/stuff"); String…
metacubed
  • 7,031
  • 6
  • 36
  • 65
2
votes
1 answer

Yii2 Url Mapping Suffix

i have some simular Url Mapping in Yii2: 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ['pattern'=>'pages','route'=>'pages/index', 'suffix'=>'/'], …
arkhamvm
  • 619
  • 1
  • 15
  • 29
2
votes
1 answer

Grails UrlMapping - cannot set params.id for controller

I'm trying to create a UrlMapping to map some static URL to a controller action, but I can't seem to set params.id. I'm working through Grails in Action, so I'm not sure what's wrong here. Code: class UrlMappings ... static mappings={ …
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
2
votes
2 answers

camel restlet component url matching

I have the following camel route My problem is why do I have match for these requests (basically I can put anything…
Zoltan Altfatter
  • 802
  • 2
  • 11
  • 25
2
votes
2 answers

Redirect / in to a static page in UrlMappings.groovy

I have a Grails 2.3.11 application which has a static html page to load JS web ui developed in ExtJS. I wanted to load the static index page by default by using redirect in UrlMapping.groovy like this: "/"(redirect: '/static/app/index.html') This…
matejk
  • 798
  • 1
  • 14
  • 27
2
votes
1 answer

Grails Reverse Url Mapping: Is there a way to build links based on the currently matched route?

I'm trying to build some dynamic URL mappings that are based on the domain classes of the grails project. The goal is to use a single generic controller, but the URL decides which domain is being used for processing. The problem is now, that I don't…
Dave
  • 420
  • 1
  • 3
  • 14
2
votes
2 answers

How to make servlet map a special url to a static resource?

I know, by the default servlet, static resources will be returned automatically. However, my url is quite special and I don't want it looks like http://mysite/app/test.html. Maybe it is like that: http://mysite/app/dosomething/7419698f I want to…
guogangj
  • 2,275
  • 3
  • 27
  • 44
2
votes
3 answers

Spring URL mapping question

I am using Java with Spring framework. Given the following url: www.mydomain.com/contentitem/234 I need to map all requests that come to /contentitem/{numeric value} mapped to a given controller with the "numeric value" passed as a parameter to…
oym
  • 6,983
  • 16
  • 62
  • 88
2
votes
0 answers

Apache mod_rewrite fake pushState directory mapping

If have played around a lot with mod_rewrite rules in my httpd.conf file. Regardless of my research i haven't been able to get a couple of things working. This is my file structure: / -index.php -app.php /css -style.css /js …
bendulum
  • 1,777
  • 1
  • 13
  • 18
2
votes
0 answers

URL masking/mapping to include relative folder path

I have web pages in www.uglyhostdomain.com/projectname/version2/index.html and own the domain www.prettydomain.com Is it possible to configure them in some way such that www.prettydomain.com acts as though the…
Gavin
  • 2,214
  • 2
  • 18
  • 26
2
votes
1 answer

Yiiframework - parse a url string to (module, controller, action) array

I am looking for a tool(class or method or ...) in Yii that, get a string (a url) and return an array contains module, controller, action and other get_params. I cannot use explode because it is possible that module dose not exists or can not find…
Masoud Nazari
  • 476
  • 2
  • 6
  • 17
2
votes
1 answer

URL Regex mapping in tornado web server

I am using tornado web server for my application. following is one of the url mapped to a handler. from publish.handler import PublishHandler, PublishedHandler URLS = [(r'/public/project/(?P.*?)/?$', PublishHandler), …
Somesh
  • 1,235
  • 2
  • 13
  • 29
2
votes
1 answer

Is there any python web framework doesn't require url mapping?

I like the way php codeigniter provide, What you need is a controller class with an action function, then you can navigate to domain.com/controller_name/action_name. no explicit mapping.
7284
  • 96
  • 7