Wiki source code of Standard URL Format

Version 26.1 by Thomas Mortagne on 2008/12/10

Hide last authors
Thomas Mortagne 1.1 1 1 URLs resolution
Thomas Mortagne 22.1 3 #startfloatingbox()
4 *Content*
5 #toc("" "" "")
6 #endfloatingbox()
Thomas Mortagne 1.1 8 In a single instance of XWiki you have many sections and the URLs need to reflect all that. This documentation details the way URLs are parsed by XWiki and what means each part of it.
Thomas Mortagne 6.1 10 {image:url.png}
Thomas Mortagne 1.1 11
12 1.1 Protocol
Thomas Mortagne 17.1 13 By default "http" is used when generating an url in XWiki.
Thomas Mortagne 1.1 14
Thomas Mortagne 17.1 15 You can set "secure" parameter to true in a wiki descriptor to generate urls with "https" in place of "http". See [How to edit wiki descriptor>manager:AdminGuide.EditWiki].
Thomas Mortagne 2.1 16
Thomas Mortagne 1.1 17 1.1 Host
Thomas Mortagne 3.1 18 * The first thing XWiki do to find the right wiki the URL is pointing to is by trying to find <tt></tt> in the list of wiki descriptors. Comparing with the content of field <tt>server</tt> in objects of class XWiki.XWikiServerClass
19 * If no descriptor can be found:
Thomas Mortagne 1.1 20 ** if the host is an IP (,, etc.) XWiki goes to main wiki
21 ** if the first part of the host name (what is before the first point) is "www" XWiki goes to main wiki
22 ** if the first part of the host name match a wiki identifier XWiki goes to this wiki
Thomas Mortagne 21.1 24 To configure the list of domain names alias to access a wiki, you have to go to the wiki's descriptor. See [How to edit wiki descriptor>manager:AdminGuide.EditWiki].
Thomas Mortagne 11.1 26 1.1 Application context (OPTIONAL)
Thomas Mortagne 1.1 27
Thomas Mortagne 14.1 28 See [platform:Main.ShortURLs#HApplicationname] for more details on how to remove this part of the url.
Thomas Mortagne 3.1 30 It's what the web container (jetty, tomcat, glassfish, etc.) use to find XWiki in all the web applications it contains. To remove it mainly depends on the possibilities and configuration of your web container.
Thomas Mortagne 1.1 31
Thomas Mortagne 14.1 32 1.1 Servlet mapping name (OPTIONAL)
Thomas Mortagne 1.1 33
Thomas Mortagne 14.1 34 See [platform:Main.ShortURLs#HServletmappingname] for more details on how to remove this part of the url.
Thomas Mortagne 1.1 35
Thomas Mortagne 14.1 36 This is used by the container to call the right servlet.
Thomas Mortagne 3.1 38 It can be:
Thomas Mortagne 19.1 39 * /bin/: this calls the Struts servlet which will calls the right action for the following part of the URL.
40 * /wiki/wikialias: call the same servlet but will be use to determine the subwiki to access if <tt>xwiki.virtiual.usepath</tt> is enabled in <tt>xwiki.cfg</tt>. Notes that you can change the "wiki" part with anything else using <tt>xwiki.virtual.usepath.servletpath</tt> and by modifying web.xml to reflect the new Struts action name.
Thomas Mortagne 3.1 41 ** XWiki tries to match a wiki descriptor with the provided <tt>wikialias</tt> like it was a domain name
Thomas Mortagne 19.1 42 ** then if it can't find any wiki descriptor it search for it with <tt>wikialias</tt> as the wiki name
Thomas Mortagne 20.1 43 * /xmlrpc/: call xmlrpc servlet. See [platform:Features.XMLRPC] for more details.
Thomas Mortagne 9.1 44 * /webdav/: call webdav servlet. See [dev:Drafts.WebDAV] for more details.
Thomas Mortagne 18.1 45
Thomas Mortagne 19.1 46
Thomas Mortagne 20.1 47
Thomas Mortagne 14.1 48 1.1 Struts action (OPTIONAL)
Thomas Mortagne 13.1 50 See [platform:Main.ShortURLs#HStrutsactionname] more more details on how to remove this part of the url.
Thomas Mortagne 3.1 51
Thomas Mortagne 14.1 52 When the servlet mapping name is <tt>bin</tt> or the value of <tt>xwiki.virtual.usepath.servletpath</tt>, XWiki use "action" identifiers to determine what is the goal of the user when going to a page.
Thomas Mortagne 3.1 53
Thomas Mortagne 14.1 54 For example if the action is "edit", XWiki will print an editor the user use to modify a page content but if the "view" action is used XWiki will execute the page content to print/render the content.
Thomas Mortagne 1.1 56 1.1 Space
Thomas Mortagne 26.1 57 All XWiki pages are located in what is called a "space". You have only one level of space but you can indicate a "parent space" for a space.
Thomas Mortagne 1.1 58
Thomas Mortagne 26.1 59 See [platform:Features.Spaces] for more details about spaces.
Thomas Mortagne 1.1 60 1.1 Page
61 The page is what contains wiki contents and objects/classes and attachments.
63 1.1 Attachment
64 This part indicate the attachment you want to download from a particular page.
Thomas Mortagne 24.1 66 See [platform:Features.Attachments] for more details about attachments.
Thomas Mortagne 4.1 67 1.1 Query string
Thomas Mortagne 1.1 68 Actions can use URL parameters to modify there action depending of there value.
70 For example you can make a velocity script that print the content of this value with:
71 {code}
72 The value of the parameter is: $request.param1
73 {code}
74 if you have a parameter "param1=Hello World" the result will be
75 {code}
76 The value of the parameter is: Hello World
77 {code}
Thomas Mortagne 6.1 78
Thomas Mortagne 25.1 79 See [platform:DevGuide.Scripting] for more details about scripting.
Thomas Mortagne 22.1 80
Thomas Mortagne 25.1 81

Get Connected