* @param action
* the action
* @return the cache tags
*/
protected CacheTagSet createCacheTags(WebloungeRequest request, Action action) {
CacheTagSet cacheTags = new CacheTagSet();
cacheTags.add(CacheTag.Url, request.getUrl().getPath());
cacheTags.add(CacheTag.Url, request.getRequestedUrl().getPath());
cacheTags.add(CacheTag.Language, request.getLanguage().getIdentifier());
cacheTags.add(CacheTag.User, request.getUser().getLogin());
cacheTags.add(CacheTag.Module, action.getModule().getIdentifier());
cacheTags.add(CacheTag.Action, action.getIdentifier());
Enumeration<?> pe = request.getParameterNames();
int parameterCount = 0;
while (pe.hasMoreElements()) {
parameterCount++;
String key = pe.nextElement().toString();
String[] values = request.getParameterValues(key);
for (String value : values) {
cacheTags.add(key, value);
}
}
cacheTags.add(CacheTag.Parameters, Integer.toString(parameterCount));
return cacheTags;
}