use of org.springframework.web.portlet.context.PortletWebRequest in project uPortal by Jasig.
the class ImagePortletController method handleRenderRequestInternal.
@Override
protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception {
final Map<String, Object> model = new HashMap<String, Object>();
final PortletPreferences preferences = request.getPreferences();
final PortletWebRequest webRequest = new PortletWebRequest(request);
// retrieve configuration information about the image from the portlet
// preferences
model.put("uri", getPreference("img-uri", webRequest, preferences));
model.put("width", getPreference("img-width", webRequest, preferences));
model.put("height", getPreference("img-height", webRequest, preferences));
model.put("border", getPreference("img-border", webRequest, preferences));
model.put("link", getPreference("img-link", webRequest, preferences));
model.put("caption", getPreference("caption", webRequest, preferences));
model.put("subcaption", getPreference("subcaption", webRequest, preferences));
model.put("alt", getPreference("alt-text", webRequest, preferences));
return new ModelAndView("/jsp/Image/imagePortlet", model);
}
use of org.springframework.web.portlet.context.PortletWebRequest in project uPortal by Jasig.
the class PortletSpELServiceImpl method getEvaluationContext.
/**
* Return a SpEL evaluation context for the supplied portlet request.
*
* @param request PortletRequest
* @return SpEL evaluation context for the supplied portlet request
*/
protected EvaluationContext getEvaluationContext(PortletRequest request) {
Map<String, String> userInfo = (Map<String, String>) request.getAttribute(PortletRequest.USER_INFO);
final SpELEnvironmentRoot root = new SpELEnvironmentRoot(new PortletWebRequest(request), userInfo);
final StandardEvaluationContext context = new StandardEvaluationContext(root);
// Allows for @myBeanName replacements
context.setBeanResolver(this.beanResolver);
return context;
}
Aggregations