List of usage examples for com.liferay.portal.kernel.servlet SessionErrors get
public static Object get(PortletRequest portletRequest, String key)
From source file:com.liferay.content.targeting.portlet.ContentTargetingPortlet.java
License:Open Source License
protected InvalidTrackingActionsException getInvalidTrackingActionsException(PortletRequest portletRequest) { if (SessionErrors.contains(portletRequest, InvalidTrackingActionsException.class.getName())) { return (InvalidTrackingActionsException) SessionErrors.get(portletRequest, InvalidTrackingActionsException.class.getName()); } else {/*from w w w. j av a 2 s .com*/ return new InvalidTrackingActionsException(); } }
From source file:com.liferay.content.targeting.portlet.ContentTargetingPortlet.java
License:Open Source License
protected InvalidRulesException getInvalidRulesException(PortletRequest portletRequest) { if (SessionErrors.contains(portletRequest, InvalidRulesException.class.getName())) { return (InvalidRulesException) SessionErrors.get(portletRequest, InvalidRulesException.class.getName()); } else {/*from w ww . j a v a 2 s. co m*/ return new InvalidRulesException(); } }
From source file:com.liferay.taglib.ui.ErrorTag.java
License:Open Source License
@Override public int doStartTag() throws JspException { try {/* w w w.ja va 2 s. com*/ HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); PortletRequest portletRequest = (PortletRequest) request .getAttribute(JavaConstants.JAVAX_PORTLET_REQUEST); request.setAttribute("liferay-ui:error:key", _key); request.setAttribute("liferay-ui:error:message", _message); request.setAttribute("liferay-ui:error:rowBreak", _rowBreak); request.setAttribute("liferay-ui:error:translateMessage", String.valueOf(_translateMessage)); if (Validator.isNotNull(_message)) { return SKIP_BODY; } if (SessionErrors.contains(portletRequest, _key)) { Object value = null; if (_exception != null) { value = SessionErrors.get(portletRequest, _exception.getName()); } else { value = SessionErrors.get(portletRequest, _key); } PortalIncludeUtil.include(pageContext, getStartPage()); if (value != null) { pageContext.setAttribute("errorException", value); } return EVAL_BODY_INCLUDE; } return SKIP_BODY; } catch (Exception e) { throw new JspException(e); } }
From source file:com.liferay.util.bridges.scripting.ScriptingPortlet.java
License:Open Source License
protected void doRender(RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { Object error = SessionErrors.get(renderRequest, _ERROR); if (error != null) { Exception e = (Exception) error; writeErrorMessage(renderRequest, renderResponse, e.getMessage()); return;/*from w ww . j a va 2s . c om*/ } super.render(renderRequest, renderResponse); error = SessionErrors.get(renderRequest, _ERROR); if (error != null) { Exception e = (Exception) error; writeErrorMessage(renderRequest, renderResponse, e.getMessage()); } }