Create a {@link DataGridStateCodec} for a grid with the given name for the given {@link ServletRequest}.
@param request the current request
@param gridName a data grid's name
@return the state encoder / decoder for a data grid's request state
976607
public DataGridStateCodec createStateCodec(ServletRequest request, String gridName) {
        DefaultDataGridStateCodec codec = new DefaultDataGridStateCodec(this);
        codec.setServletRequest(request);
        codec.setGridName(gridName);
        return codec;
    }
1083416
protected String getEncoding(HttpServletRequest request) {
        final String encoding = request.getCharacterEncoding();
        if (encoding != null) {
            return encoding;
        }

        return this.defaultEncoding;
    }
176023
public String getParam(final HttpServletRequest request, final String name,
      final String defaultVal) {
    return HttpRequestUtils.getParam(request, name, defaultVal);
  }
962293
protected String generateNOnce(MobicentsSipServletRequest request) {

        long currentTime = System.currentTimeMillis();

        String nOnceValue = request.getRemoteAddr() + ":" +
            currentTime + ":" + key;

        byte[] buffer = null;
        synchronized (md5Helper) {
            buffer = md5Helper.digest(nOnceValue.getBytes());
        }
        nOnceValue = MD5_ENCODER.encode(buffer);

        return nOnceValue;
    }
134409
public CreateWaterMarkResponse createWaterMark(CreateWaterMarkRequest request) {
        checkStringNotEmpty(request.getBucket(), "The parameter bucket should NOT be null or empty string.");
        checkStringNotEmpty(request.getKey(), "The parameter key should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, WATER_MARK);
        
        return invokeHttpClient(internalRequest, CreateWaterMarkResponse.class);
    }
1374922
private String renderNameAndId(HttpServletRequest request, String id)
    {
        // if id is not set then we need to exit
        if (id == null)
            return null;

        // Legacy Java Script support -- This writes out a single table with both the id and names
        // mixed.  This is legacy support to match the pre beehive behavior.
        String idScript = null;
        IScriptReporter scriptReporter = getScriptReporter();
        ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
        if (TagConfig.isLegacyJavaScript()) {
            idScript = srs.mapLegacyTagId(scriptReporter, id, _state.id);
        }

        // map the tagId to the real id
        if (TagConfig.isDefaultJavaScript()) {
            String script = srs.mapTagId(scriptReporter, id, _state.id, _state.name);

            // if we wrote out script in legacy mode, we need to make sure we preserve it.
            if (idScript != null) {
                idScript = idScript + script;
            }
            else {
                idScript = script;
            }
        }
        return idScript;
    }
166327
public static String getParameter(final Request request, final String parameterName)
	{
		String parameterValue = request.getRequestParameters().getParameterValue(parameterName)
			.toString();
		if ((parameterValue == null) || parameterValue.isEmpty())
		{
			parameterValue = request.getPostParameters().getParameterValue(parameterName)
				.toString();
		}
		if ((parameterValue == null) || parameterValue.isEmpty())
		{
			parameterValue = request.getQueryParameters().getParameterValue(parameterName)
				.toString();
		}
		if ((parameterValue == null) || parameterValue.isEmpty())
		{
			parameterValue = request.getRequestParameters().getParameterValue(parameterName)
				.toString();
		}
		return parameterValue;
	}
996909
public static Object getActionOutput( String name, ServletRequest request )
    {
        Map map = InternalUtils.getActionOutputMap( request, false );
        return map != null ? map.get( name ) : null;
    }
775549
protected Map<String,String> convertParametersTextToMap(HTTPRequest request)
    {
        //init data structure
        Map<String,String> map=new HashMap<String,String>();

        //get parameters text
        String parametersText=request.getParametersText();
        
        if(parametersText!=null)
        {
            //split to key/value pairs (key=value)
            String[] keyValuePairs=parametersText.split("&");
            
            //get amount
            int pairsAmount=keyValuePairs.length;
            
            String keyValuePair=null;
            String[] parts=null;
            String key=null;
            String value=null;
            for(int index=0;index<pairsAmount;index++)
            {
                //get next key/value pair
                keyValuePair=keyValuePairs[index];
                
                //split to key and value
                parts=keyValuePair.split("=");
                if(parts.length==2)
                {
                    //get key
                    key=parts[0];
                    if(key.length()>0)
                    {
                        //decode key
                        key=SpiUtil.urlDecode(key);

                        //get value
                        value=parts[1].trim();

                        //decode value
                        value=SpiUtil.urlDecode(value);
                        
                        //put in data structure
                        map.put(key,value);
                    }
                }
            }
        }
        
        return map;
    }
55937
protected DataSource getDataSource( HttpServletRequest request, String key )
    {
        // Return the requested data source instance
        return ( DataSource ) getServletContext().getAttribute( key + getModuleConfig().getPrefix() );
    }
456595
public static Object getComponentInstance(String name, HttpServletRequest request) {
		ServletContext sc = request.getSession().getServletContext();
		ContainerWrapper containerWrapper = scf.findContainer(new ServletContextWrapper(sc));
		if (!containerWrapper.isStart()) {
			Debug.logError("JdonFramework not yet started, please try later ", module);
			return null;
		}
		return containerWrapper.lookup(name);
	}
1241601
public static Map<String, Object> createRequestAttributesMap(HttpServletRequest request) {
        Map<String, Object> attributesMap = new HashMap<>();
        for (Enumeration attributeNameEnum = request.getAttributeNames(); attributeNameEnum.hasMoreElements(); ) {
            String attributeName = (String)attributeNameEnum.nextElement();

            attributesMap.put(attributeName, request.getAttribute(attributeName));
        }

        return attributesMap;
    }
421667
public CreateJobResponse createJob(CreateJobRequest request) {
        checkNotNull(request, "request should not be null.");
        checkStringNotEmpty(request.getName(), "The name should not be null or empty string.");
        checkStringNotEmpty(request.getVmType(), "The vmType should not be null or empty string.");
        checkStringNotEmpty(request.getJobDagJson(), "The jobDagJson should not be null or empty string.");
        checkIsTrue(request.getVmCount() > 0, "The vmCount should greater than 0");

        StringWriter writer = new StringWriter();
        try {
            JsonGenerator jsonGenerator = JsonUtils.jsonGeneratorOf(writer);
            jsonGenerator.writeStartObject();
            jsonGenerator.writeStringField("name", request.getName());
            jsonGenerator.writeStringField("vmType", request.getVmType());
            jsonGenerator.writeNumberField("vmCount", request.getVmCount());
            jsonGenerator.writeStringField("jobDagJson", request.getJobDagJson());
            if (request.getJobTimeoutInSeconds() != null) {
                jsonGenerator.writeNumberField("jobTimeoutInSeconds", request.getJobTimeoutInSeconds());
            }
            if (request.getMemo() != null) {
                jsonGenerator.writeStringField("memo", request.getMemo());
            }
            jsonGenerator.writeEndObject();
            jsonGenerator.close();
        } catch (IOException e) {
            throw new BceClientException("Fail to generate json", e);
        }

        byte[] json = null;
        try {
            json = writer.toString().getBytes(DEFAULT_ENCODING);
        } catch (UnsupportedEncodingException e) {
            throw new BceClientException("Fail to get UTF-8 bytes", e);
        }

        InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST, JOB);
        internalRequest.addHeader(Headers.CONTENT_LENGTH, String.valueOf(json.length));
        internalRequest.addHeader(Headers.CONTENT_TYPE, "application/json");
        internalRequest.setContent(RestartableInputStream.wrap(json));

        internalRequest.addParameter("run", "immediate");
        if (request.getClientToken() != null) {
            internalRequest.addParameter("clientToken", request.getClientToken());
        }

        return this.invokeHttpClient(internalRequest, CreateJobResponse.class);
    }
1289181
public static Map<String, String[]> getParameterMap(final Request request)
	{
		final Map<String, String[]> map = new HashMap<>();
		addParameters(request.getRequestParameters(), map);
		addParameters(request.getQueryParameters(), map);
		addParameters(request.getPostParameters(), map);
		return map;
	}
275021
@SneakyThrows
    public final T encode(final RequestAbstractType request, final T samlObject, final String relayState) throws SamlException {
        if (httpResponse != null) {
            val encoder = getMessageEncoderInstance();
            encoder.setHttpServletResponse(httpResponse);

            val ctx = getEncoderMessageContext(request, samlObject, relayState);
            encoder.setMessageContext(ctx);
            finalizeEncode(request, encoder, samlObject, relayState);
        }
        return samlObject;

    }
923144
public static BigDecimal getBigDecimalParameter(final HttpServletRequest request, final String name) {
		String value = request.getParameter(name);
		if (StringUtils.isBlank(value)) {
			return null;
		}
		return new BigDecimal(value);
	}
884326
public CreateTranscodingJobResponse createTranscodingJob(CreateTranscodingJobRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        
        checkStringNotEmpty(request.getPipelineName(),
                "The parameter pipelineName should NOT be null or empty string.");
        checkNotNull(request.getSource(), "The parameter source should NOT be null.");
        checkNotNull(request.getTarget(), "The parameter target should NOT be null.");
        checkStringNotEmpty(request.getTarget().getTargetKey(),
                "The parameter targetKey should NOT be null or empty string.");
        checkStringNotEmpty(request.getTarget().getPresetName(),
                "The parameter presetName should NOT be null or empty string.");
        
        InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, TRANSCODE_JOB);

        return invokeHttpClient(internalRequest, CreateTranscodingJobResponse.class);
    }