Wiki source code of Confluence User Macro - Getting the Request string
Last modified by Normann P. Nielsen on 2025/12/12 15:11
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | Fetched from [[https://confluence.atlassian.com/display/DOC/Include+Page+Macro]] |
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | {{code}} | ||
| 7 | #set ($qString = $req.getQueryString()) | ||
| 8 | #set ($titleStart = $qString.indexOf("title=")+6) | ||
| 9 | #set ($nextAmpIndex = $qString.indexOf("&",$titleStart)) | ||
| 10 | #if ($nextAmpIndex == -1) | ||
| 11 | #set ($titleEnd = $qString.length()) | ||
| 12 | #else | ||
| 13 | #set ($titleEnd = $nextAmpIndex) | ||
| 14 | #end | ||
| 15 | #set ($reqTitle = $qString.substring($titleStart, $titleEnd)) | ||
| 16 | {{/code}} | ||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | Very nice for getting the params from a QueryString - I am thinking of making a "Show Image" page in the [[Mos-Eisley Gallery>>Main.atlassian.atlassian-confluence.mos-eisley-gallery]], using QueryString params |