Hide last authors
Manuel Smeria 50.2 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
Thomas Mortagne 1.1 4
Silvia Macovei 49.3 5 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 each part of it means.
Thomas Mortagne 1.1 6
Manuel Smeria 50.2 7 {{image reference="url.png"/}}
Thomas Mortagne 1.1 8
Silvia Macovei 49.2 9 = Protocol =
Silvia Macovei 49.1 10
Thomas Mortagne 17.1 11 By default "http" is used when generating an url in XWiki.
Thomas Mortagne 1.1 12
Manuel Smeria 50.2 13 In virtual mode, you can set the "secure" parameter to true in a wiki descriptor to generate URLs with "https" instead of "http". See [[how to modify the wiki descriptor>>manager:AdminGuide.EditWikiDescriptor]].
Thomas Mortagne 2.1 14
Silvia Macovei 49.2 15 = Host =
Thomas Mortagne 37.1 16
Manuel Smeria 50.2 17 In virtual mode it is used to determine the wiki to access. See [[the domain name based wiki access>>platform:AdminGuide.AccessWiki#HThedomainnamebasedwikiaccess]] for more details.
Thomas Mortagne 39.1 18
Thomas Mortagne 41.1 19 In non-virtual mode is has no effect.
20
Silvia Macovei 49.2 21 = Application context (OPTIONAL) =
Thomas Mortagne 1.1 22
Manuel Smeria 50.2 23 See [[Short URLs>>platform:Main.ShortURLs#HI.Applicationname]] for more details on how to remove this part of the url.
Thomas Mortagne 14.1 24
Silvia Macovei 49.3 25 It's what the web container (jetty, tomcat, glassfish, etc.) use to find XWiki in all the web applications it contains. Removing it mainly depends on the possibilities and configuration of your web container.
Thomas Mortagne 1.1 26
Silvia Macovei 49.2 27 = Servlet mapping name (OPTIONAL) =
Thomas Mortagne 1.1 28
Manuel Smeria 50.2 29 See [[Short URLs>>platform:Main.ShortURLs#HII.Servletmappingname]] for more details on how to remove this part of the url.
Thomas Mortagne 1.1 30
Thomas Mortagne 14.1 31 This is used by the container to call the right servlet.
32
Thomas Mortagne 3.1 33 It can be:
Silvia Macovei 49.1 34
Vincent Massol 51.1 35 * ##/bin/##: this calls the Struts servlet which will call the right action for the following part of the URL
36 * ##/wiki/[wikialias]##: calls the same servlet but will be used to determine the subwiki to access if ##xwiki.virtual.usepath## is enabled in ##xwiki.cfg##. Note that you can change the "wiki" part with anything else using ##xwiki.virtual.usepath.servletpath## and by modifying web.xml to reflect the new Struts action name (see [[the URL path based wiki access>>platform:AdminGuide.AccessWiki#HTheURLpathbasedwikiaccess]] for more details)
37 * ##/xmlrpc/##: call xmlrpc servlet (see [[platform:Features.XMLRPC]] for more details)
38 * ##/webdav/##: call webdav servlet (see [[Web DAV>>platform:Features.WebDAV]] for more details)
39 * ##/rest/##: call REST servlet (see [[XWiki RESTful API>>platform:Features.XWikiRESTfulAPI]] for more details)
Thomas Mortagne 18.1 40
Vincent Massol 51.1 41 = Action (OPTIONAL) =
Thomas Mortagne 14.1 42
Manuel Smeria 50.2 43 See the [[struts action name>>platform:Main.ShortURLs#HIII.Strutsactionname]] section for more details on how to remove this part of the url.
Thomas Mortagne 3.1 44
Manuel Smeria 50.2 45 When the servlet mapping name is ##bin## or the value of ##xwiki.virtual.usepath.servletpath## XWiki uses "action" identifiers to determine what the goal of the user when going to a page is.
Thomas Mortagne 3.1 46
Manuel Smeria 50.2 47 For example if the action is "edit" XWiki will print the editor the user used to modify the page content but if the "view" action is used, XWiki will execute the page content to print/render the content.
Thomas Mortagne 14.1 48
Silvia Macovei 49.2 49 = Space =
Silvia Macovei 49.1 50
Manuel Smeria 50.2 51 Any wiki page is located in what is called a "space".
Thomas Mortagne 1.1 52
Silvia Macovei 49.1 53 See [[platform:Features.Spaces]] for more details about spaces.
Thomas Mortagne 27.1 54
Silvia Macovei 49.2 55 = Page (OPTIONAL) =
Thomas Mortagne 28.1 56
Silvia Macovei 49.3 57 The page contains wiki contents, objects/classes and attachments.
Thomas Mortagne 1.1 58
Oana Florea 52.1 59 When no page is specified like in the url ##http:~/~/host/xwiki/bin/view/Space/ ## the "WebHome" page name is used.
Thomas Mortagne 33.1 60
Vincent Massol 51.1 61 = Attachment (OPTIONAL) =
Thomas Mortagne 43.1 62
Silvia Macovei 49.3 63 This part indicates the attachment you want to download from a particular page.
Thomas Mortagne 1.1 64
Silvia Macovei 49.1 65 See [[platform:Features.Attachments]] for more details about attachments.
Thomas Mortagne 44.1 66
Vincent Massol 51.1 67 = Query string (OPTIONAL) =
Silvia Macovei 49.1 68
Silvia Macovei 49.2 69 == Standard parameters ==
Silvia Macovei 49.1 70
Vincent Massol 51.1 71 Some of the parameters in the URL have a "system" meaning depending of the action.
Thomas Mortagne 44.1 72
Vincent Massol 51.1 73 === ##view## Action ===
Silvia Macovei 49.1 74
Silvia Macovei 49.2 75 ==== xpage ====
Silvia Macovei 49.1 76
Vincent Massol 50.4 77 * ##plain##: this value indicates that only the content of the page is printed (no UI). With a document that's not using the XWiki 1.0 syntax you can control the output syntax using ##outputSyntax## and ##outputSyntaxVersion##. You can also pass another parameter named ##raw## which allows you more control:
Vincent Massol 50.1 78 ** ##raw=1##: Returns the page source as is without any formatting but XML-escaped
79 ** ##raw=2##: Returns the page source as is without any formatting (without any escaping)
Guillaume Delhumeau 53.1 80 ** ##htmlHeaderAndFooter=true##: Display the HTML headers (##<html>##,##<head>##,##<body>##, etc...) and footers (##</body>##, ##</html>##, etc...).
Vincent Massol 50.1 81 * ##xml##: print the exported form of a document. This is what you can find in the xar for each document.
Vincent Massol 51.1 82 * ##rev##: when specified, redirects to the ##viewrev## action (see below)
Thomas Mortagne 44.1 83
Silvia Macovei 49.2 84 ==== outputSyntax and outputSyntaxVersion ====
Thomas Mortagne 44.1 85
Vincent Massol 50.4 86 With a document that's not using the XWiki 1.0 syntax it's possible to explicitly indicate the renderer to use for the page content. For example with ##outputSyntax=plain## you will get the result in plain text. ##outputSyntaxVersion## is an optional parameter, if it's not provided XWiki will search for the last version of the renderer for the given ##outputSyntax## syntax name. Note that outputSyntax controls only the document content output syntax. If you only want the document content you can use ##xpage=plain##.
Thomas Mortagne 48.1 87
Manuel Smeria 50.2 88 See [[extensions:Extension.Rendering Module]] for more details on renderers.
Thomas Mortagne 45.1 89
Vincent Massol 51.1 90 === ##export## Action ===
Thomas Mortagne 45.1 91
Silvia Macovei 49.1 92 See [[platform:Features.Exports]].
93
Vincent Massol 51.1 94 === ##viewrev## Action ===
Silvia Macovei 49.1 95
Vincent Massol 51.1 96 This action is the same as the ##view## action but allowing to address a given revision of the document asked.
97
Vincent Massol 52.2 98 * ##rev##: the version to get, e.g. ##2.3## in ##http:~/~/host/xwiki/bin/viewrev/MySpace/MyPage?rev=2.3##
Vincent Massol 51.1 99
Oana Florea 52.1 100 === ##get## Action ===
101
102 The ##get## action should be used to render the content of the page and nothing else (mainly used for code pages). This action is similar to the ##view## action, but without the UI and with "text/plain" mime type set by default for the response.
103
Guillaume Delhumeau 53.1 104 This action takes the following parameter:
105 * ##htmlHeaderAndFooter=true##: Display the HTML headers (##<html>##,##<head>##,##<body>##, etc...) and footers (##</body>##, ##</html>##, etc...).
106
Vincent Massol 51.1 107 == Custom parameters ==
108
Manuel Smeria 50.2 109 Actions can use URL parameters to modify their action depending on their value.
Thomas Mortagne 1.1 110
Silvia Macovei 49.3 111 For example you can make a velocity script that prints the content of this value with:
Silvia Macovei 49.1 112
113 {{code}}
Thomas Mortagne 1.1 114 The value of the parameter is: $request.param1
Silvia Macovei 49.1 115 {{/code}}
116
Thomas Mortagne 1.1 117 if you have a parameter "param1=Hello World" the result will be
Silvia Macovei 49.1 118
119 {{code}}
Thomas Mortagne 1.1 120 The value of the parameter is: Hello World
Silvia Macovei 49.1 121 {{/code}}
Thomas Mortagne 6.1 122
Silvia Macovei 49.1 123 See [[platform:DevGuide.Scripting]] for more details about scripting.

Get Connected