List of usage examples for javax.servlet.jsp PageContext getRequest
abstract public ServletRequest getRequest();
From source file:org.qifu.ui.UIComponentValueUtils.java
public static Object getObjectFromPageContextOrRequest(PageContext pageContext, String paramName) { HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); /**/*from w w w .j a va 2 s . c o m*/ * ?: pageContext.getAttribute > request.getParameter > request.getAttribute */ if (pageContext.getAttribute(paramName) != null) { return pageContext.getAttribute(paramName); } return (request.getParameter(paramName) != null ? request.getParameter(paramName) : request.getAttribute(paramName)); }
From source file:org.qifu.ui.UIComponentValueUtils.java
public static Object getObjectFromSession(PageContext pageContext, String paramName) { HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); return request.getSession().getAttribute(paramName); }
From source file:org.qifu.ui.UIComponentValueUtils.java
public static Object getOgnlProcessObjectFromPageContextOrRequest(PageContext pageContext, String expression) { Map<String, Object> ognlRoot = new HashMap<String, Object>(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); Enumeration<String> pcNames = pageContext.getAttributeNamesInScope(PageContext.PAGE_SCOPE); Enumeration<String> pNames = request.getParameterNames(); Enumeration<String> aNames = request.getAttributeNames(); /**// w w w .j a v a2s .c o m * ognlRoot , ?: pageContext.getAttribute > request.getParameter > request.getAttribute */ while (pcNames.hasMoreElements()) { String key = pcNames.nextElement(); ognlRoot.put(key, pageContext.getAttribute(key)); } while (pNames.hasMoreElements()) { String key = pNames.nextElement(); if (ognlRoot.get(key) == null) { ognlRoot.put(key, request.getParameter(key)); } } while (aNames.hasMoreElements()) { String key = aNames.nextElement(); if (ognlRoot.get(key) == null) { ognlRoot.put(key, request.getAttribute(key)); } } if (ognlRoot.size() == 0) { ognlRoot = null; return null; } Object val = null; try { val = Ognl.getValue(expression, ognlRoot); } catch (OgnlException e) { //e.printStackTrace(); } ognlRoot.clear(); ognlRoot = null; return val; }
From source file:org.qifu.ui.UIComponentValueUtils.java
public static Object getOgnlProcessObjectFromHttpSession(PageContext pageContext, String expression) { Map<String, Object> ognlRoot = new HashMap<String, Object>(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); Enumeration<String> aNames = request.getSession().getAttributeNames(); while (aNames.hasMoreElements()) { String key = aNames.nextElement(); ognlRoot.put(key, request.getAttribute(key)); }/*from w w w. j a v a 2s .c om*/ if (ognlRoot.size() == 0) { ognlRoot = null; return null; } Object val = null; try { val = Ognl.getValue(expression, ognlRoot); } catch (OgnlException e) { //e.printStackTrace(); } ognlRoot.clear(); ognlRoot = null; return val; }
From source file:org.silverpeas.core.web.util.viewgenerator.html.arraypanes.AbstractArrayPane.java
@Override public void init(String name, PageContext pageContext) { init(name, pageContext.getRequest(), pageContext.getSession()); }
From source file:org.squale.welcom.taglib.canvas.CanvasTag.java
/** * surcharge du on load// w w w . j a va 2 s . c o m * * @param pageContext contexte * @param oldOnLoad ancien onload su body * @return le onload formatte */ public static String addMessagePopupOnOnLoad(final PageContext pageContext, final String oldOnLoad) { // on gere un 2eme stringbuffer au cas ou on aurait pas besoin de onload final StringBuffer sbOnload = new StringBuffer(); final Object logonBean = (pageContext.getSession().getAttribute(WConstants.USER_KEY)); final String msg = WResultAction.readMessage(pageContext.getRequest()); if (!GenericValidator.isBlankOrNull(msg)) { sbOnload.append("javascript:alert(\'" + Util.formatJavaScript(msg) + "\');"); // message afficher, suppression du message WResultAction.resetMessage(pageContext.getRequest()); } if (!GenericValidator.isBlankOrNull(oldOnLoad)) { sbOnload.append(ResponseUtils.filter(oldOnLoad) + ";"); } return sbOnload.toString(); }
From source file:org.squale.welcom.taglib.menu.impl.MenuSkinLight.java
/** * @see org.squale.welcom.taglib.menu.IMenuRender#doPrintHeader(javax.servlet.jsp.tagext.Tag, * javax.servlet.jsp.PageContext)//from www. jav a 2s. c om */ public String doPrintHeader(final Tag tag, final PageContext pageContext) throws JspException { if (pageContext.getRequest().getAttribute(MENU_KEY) == null) { CanvasUtil.addCss("css/comMenuLight.css", tag, pageContext); pageContext.getRequest().setAttribute(MENU_KEY, this); } return ""; }
From source file:org.squale.welcom.taglib.menu.impl.MenuSkinV2.java
/** * @see org.squale.welcom.taglib.menu.IMenuRender#doPrintHeader() *///from w w w . j a v a 2 s . c o m public String doPrintHeader(final Tag tag, final PageContext pageContext) throws JspException { final StringBuffer buf = new StringBuffer(); if (pageContext.getRequest().getAttribute(MENU_KEY) == null) { CanvasUtil.addJs(WelcomConfigurator.getMessage(WelcomConfigurator.CHARTEV2_MENU_JSURL), tag, pageContext); pageContext.getRequest().setAttribute(MENU_KEY, "in"); } buf.append("<script language=\"JavaScript\">\n"); if ("UNI".equals(WelcomConfigurator.getMessage(WelcomConfigurator.CHARTEV2_ID))) { buf.append("mv2_style_top_menuv = 110;"); } buf.append("/* Debut de la generation du menu */\n"); return buf.toString(); }
From source file:org.squale.welcom.taglib.menu.impl.MenuSkinV3001.java
/** * @see org.squale.welcom.taglib.menu.IMenuRender#doPrintHeader() *///from w ww.ja v a 2 s . c om public String doPrintHeader(final Tag tag, final PageContext pageContext) throws JspException { final StringBuffer buf = new StringBuffer(); if (pageContext.getRequest().getAttribute(MENU_KEY) == null) { CanvasUtil.addJs(WelcomConfigurator.getMessage(WelcomConfigurator.CHARTEV3_MENU_JSURL), tag, pageContext); buf.append("<script language=\"JavaScript\">\n"); /* * if ("app".equalsIgnoreCase(WelcomConfigurator.getMessage("chartev3.id"))) { buf.append("var * Menu_Horizontal_Application = true;\n"); buf.append("var Menu_Vertical_Application = true;\n"); } */ pageContext.getRequest().setAttribute(MENU_KEY, "in"); } else { buf.append("<script language=\"JavaScript\">\n"); } buf.append("/* Debut de la generation du menu */\n"); return buf.toString(); }
From source file:org.squale.welcom.taglib.table.ListColumnSort.java
/** * Ajoute le colSort en fonction a ajouter * //from www. j a v a 2 s . c o m * @param pageContext pageContext */ public void addColSort(final PageContext pageContext) { final ColSort colSort = new ColSort(); if (getCle(getName(), getProperty()).equals(pageContext.getRequest().getParameter("table"))) { colSort.setColumn(pageContext.getRequest().getParameter("colonne")); colSort.setType(pageContext.getRequest().getParameter("type")); colSort.setDateFormat(pageContext.getRequest().getParameter("dateformat")); colSort.setSort(SortOrder.getSortOrder(pageContext.getRequest().getParameter("sens"))); addColSort(colSort); } }