| 1101 | |
| 1102 | |
| 1103 | @Override |
| 1104 | public String encodeURL(String url) { |
| 1105 | |
| 1106 | String absolute; |
| 1107 | try { |
| 1108 | absolute = toAbsolute(url); |
| 1109 | } catch (IllegalArgumentException iae) { |
| 1110 | // URL construction failed |
| 1111 | return url; |
| 1112 | } |
| 1113 | |
| 1114 | if (isEncodeable(absolute)) { |
| 1115 | Session session = request.getSessionInternal(); |
| 1116 | if (session != null) { |
| 1117 | // W3c spec clearly said |
| 1118 | if (url.equalsIgnoreCase("")) { |
| 1119 | url = absolute; |
| 1120 | } else if (url.equals(absolute) && !hasPath(url)) { |
| 1121 | url += '/'; |
| 1122 | } |
| 1123 | return toEncoded(url, session.getIdInternal()); |
| 1124 | } |
| 1125 | } |
| 1126 | return url; |
| 1127 | } |
| 1128 | |
| 1129 | |
| 1130 | /** |