use of org.grails.web.servlet.mvc.GrailsWebRequest in project grails-core by grails.
the class GrailsFlashScope method registerWithSessionIfNecessary.
private void registerWithSessionIfNecessary() {
if (registerWithSession) {
GrailsWebRequest webRequest = (GrailsWebRequest) RequestContextHolder.currentRequestAttributes();
HttpSession session = webRequest.getCurrentRequest().getSession(true);
if (session.getAttribute(GrailsApplicationAttributes.FLASH_SCOPE) == null) {
session.setAttribute(GrailsApplicationAttributes.FLASH_SCOPE, this);
}
}
}
use of org.grails.web.servlet.mvc.GrailsWebRequest in project grails-core by grails.
the class CachingLinkGenerator method makeKey.
protected String makeKey(String prefix, Map attrs) {
StringBuilder sb = new StringBuilder();
sb.append(prefix);
if (getConfiguredServerBaseURL() == null && isAbsolute(attrs)) {
if (attrs.get(ATTRIBUTE_BASE) != null) {
sb.append(attrs.get(ATTRIBUTE_BASE));
} else {
GrailsWebRequest webRequest = GrailsWebRequest.lookup();
if (webRequest != null) {
sb.append(webRequest.getBaseUrl());
}
}
}
appendMapKey(sb, attrs);
return sb.toString();
}
Aggregations