// Some viewId may have query string, so handle that here
// (e.g., TaskFlow has the following viewId:
// /adf.task-flow?_document=/WEB-INF/task-flow.xml&_id=task1
int queryStart = viewId.indexOf('?');
QueryString queryStr = null;
if (queryStart != -1)
{
// parse the query string and add the parameters to internal maps
// delay the creation of ParameterMap and ParameterValuesMap until
// they are needed/called by the client
queryStr = new QueryString(viewId.substring(queryStart + 1), "UTF8");
// TODO: Constants
// We store these into a temporary Map until a client calls the corresponding
// ExternalContext public api to get the request parameter map(s). In those
// methods we use these temp maps to build the overall Map that is returned.
// This roundabout technique is used to delay accessing request parameters until the
// client first requests them.
mTempExtraRequestParameterMap = new HashMap<String, String>(5);
mTempExtraRequestParameterValuesMap = new HashMap<String, String[]>(5);
// Clear any existing Request ParameterMap to ensure reconstruction
// with these new extra entries.
mRequestParameterMap = null;
mRequestParameterValuesMap = null;
Enumeration<String> list = queryStr.getParameterNames();
while (list.hasMoreElements())
{
String param = list.nextElement();
mTempExtraRequestParameterMap.put(param, queryStr.getParameter(param));
// Now deal with the multiValue case
Enumeration<String> e = queryStr.getParameterValues(param);
ArrayList<String> l = new ArrayList(5);
while (e.hasMoreElements())
{
l.add(e.nextElement());
}