@Override public Map<String, String[]> getParameterMap() { Map<String, String[]> map = new HashMap<>(); if (_inherit) { map.putAll(super.getParameterMap()); } map.putAll(_params); return map; }
@Override public Enumeration<String> getParameterNames() { Set<String> names = new LinkedHashSet<>(); if (_inherit) { Enumeration<String> enu = super.getParameterNames(); while (enu.hasMoreElements()) { names.add(enu.nextElement()); } } names.addAll(_params.keySet()); return Collections.enumeration(names); }
@Override public String[] getParameterValues(String name) { String[] values = _params.get(name); if (_inherit && (values == null)) { return super.getParameterValues(name); } return values; }
@Override public String getParameter(String name) { String[] values = _params.get(name); if (_inherit && (values == null)) { return super.getParameter(name); } if (ArrayUtil.isNotEmpty(values)) { return values[0]; } return null; }
/** * The JSF 2.x version of the TCK has a dependency on Trinidad 2.x, which needs to be able to detect the browser * (user-agent) that issued the request in order to determine whether-or-not Partial Page Rendering (PPR) is * enabled/disabled. Specifically, the {@link * org.apache.myfaces.trinidadinternal.agent.AgentFactoryImpl#_getUserAgentHeader(Map<String, String>))} method will * call {@link javax.faces.context.ExternalContext#getRequestHeaderMap()} in order to get the "User-Agent" header. * Liferay provides a way of determining this header from the underlying HttpServletRequest, but Pluto does not. * Therefore in order for PPR tests like TestPage073 (scopeAfterRedisplayResourcePPRTest) to work with PPR, it is * necessary to return a bogus value here. */ @Override public Enumeration<String> getProperties(String name) { if ("User-Agent".equalsIgnoreCase(name)) { List<String> propertyList = new ArrayList<String>(); propertyList.add("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1"); return Collections.enumeration(propertyList); } else { return super.getProperties(name); } } }