Strips a servlet session ID from url . The session ID is encoded as a URL "path parameter" beginning with "jsessionid=". We thus remove anything we find between ";jsessionid=" (inclusive) and either EOS or a subsequent ';' (exclusive). taken from org.apache.taglibs.standard.tag.common.
(String url)
| 172 | * @return the URL without a user submitted session id parameter |
| 173 | */ |
| 174 | public static String stripSession(String url) { |
| 175 | StringBuilder u = new StringBuilder(url); |
| 176 | int sessionStart; |
| 177 | while ((sessionStart = u.toString().indexOf(";" + "jsessionid" /* FIXME */ + "=")) != -1) { |
| 178 | int sessionEnd = u.toString().indexOf(';', sessionStart + 1); |
| 179 | if (sessionEnd == -1) { |
| 180 | sessionEnd = u.toString().indexOf('?', sessionStart + 1); |
| 181 | } |
| 182 | if (sessionEnd == -1) { |
| 183 | sessionEnd = u.length(); |
| 184 | } |
| 185 | u.delete(sessionStart, sessionEnd); |
| 186 | } |
| 187 | return u.toString(); |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Performs the following substring replacements (to facilitate output to XML/HTML pages): |