Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
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.
6
7 {{image reference="url.png"/}}
8
9 = Protocol =
10
11 By default "http" is used when generating an url in XWiki.
12
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]].
14
15 = Host =
16
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.
18
19 In non-virtual mode is has no effect.
20
21 = Application context (OPTIONAL) =
22
23 See [[Short URLs>>platform:Main.ShortURLs#HI.Applicationname]] for more details on how to remove this part of the url.
24
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.
26
27 = Servlet mapping name (OPTIONAL) =
28
29 See [[Short URLs>>platform:Main.ShortURLs#HII.Servletmappingname]] for more details on how to remove this part of the url.
30
31 This is used by the container to call the right servlet.
32
33 It can be:
34
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)
40
41 = Action (OPTIONAL) =
42
43 See the [[struts action name>>platform:Main.ShortURLs#HIII.Strutsactionname]] section for more details on how to remove this part of the url.
44
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.
46
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.
48
49 = Space =
50
51 Any wiki page is located in what is called a "space".
52
53 See [[platform:Features.Spaces]] for more details about spaces.
54
55 = Page (OPTIONAL) =
56
57 The page contains wiki contents, objects/classes and attachments.
58
59 When no page is specified like in the url ##http:~/~/host/xwiki/bin/view/Space/ ## the "WebHome" page name is used.
60
61 = Attachment (OPTIONAL) =
62
63 This part indicates the attachment you want to download from a particular page.
64
65 See [[platform:Features.Attachments]] for more details about attachments.
66
67 = Query string (OPTIONAL) =
68
69 == Standard parameters ==
70
71 Some of the parameters in the URL have a "system" meaning depending of the action.
72
73 === ##view## Action ===
74
75 ==== xpage ====
76
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:
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)
80 ** ##htmlHeaderAndFooter=true##: Display the HTML headers (##<html>##,##<head>##,##<body>##, etc...) and footers (##</body>##, ##</html>##, etc...).
81 * ##xml##: print the exported form of a document. This is what you can find in the xar for each document.
82 * ##rev##: when specified, redirects to the ##viewrev## action (see below)
83
84 ==== outputSyntax and outputSyntaxVersion ====
85
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##.
87
88 See [[extensions:Extension.Rendering Module]] for more details on renderers.
89
90 === ##export## Action ===
91
92 See [[platform:Features.Exports]].
93
94 === ##viewrev## Action ===
95
96 This action is the same as the ##view## action but allowing to address a given revision of the document asked.
97
98 * ##rev##: the version to get, e.g. ##2.3## in ##http:~/~/host/xwiki/bin/viewrev/MySpace/MyPage?rev=2.3##
99
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
104 This action takes the following parameter:
105 * ##htmlHeaderAndFooter=true##: Display the HTML headers (##<html>##,##<head>##,##<body>##, etc...) and footers (##</body>##, ##</html>##, etc...).
106
107 == Custom parameters ==
108
109 Actions can use URL parameters to modify their action depending on their value.
110
111 For example you can make a velocity script that prints the content of this value with:
112
113 {{code}}
114 The value of the parameter is: $request.param1
115 {{/code}}
116
117 if you have a parameter "param1=Hello World" the result will be
118
119 {{code}}
120 The value of the parameter is: Hello World
121 {{/code}}
122
123 See [[platform:DevGuide.Scripting]] for more details about scripting.

Get Connected