本文整理匯總了Java中com.sun.jersey.spi.container.ContainerRequest.getQueryParameters方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerRequest.getQueryParameters方法的具體用法?Java ContainerRequest.getQueryParameters怎麽用?Java ContainerRequest.getQueryParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.jersey.spi.container.ContainerRequest
的用法示例。
在下文中一共展示了ContainerRequest.getQueryParameters方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: filter
import com.sun.jersey.spi.container.ContainerRequest; //導入方法依賴的package包/類
@Override
public ContainerRequest filter(ContainerRequest request) {
// only if the query parameters contain the configured name
// and one of the values from "fromValues"
if (request.getQueryParameters() != null
&& !request.getQueryParameters().isEmpty()
&& request.getQueryParameters().containsKey(queryParamToModify)
&& ArrayUtils.contains(fromValues,
request.getQueryParameters().getFirst(queryParamToModify))) {
URI modifiedUri = getModifiedUri(request.getRequestUri());
request.setUris(request.getBaseUri(), modifiedUri);
}
return request;
}
示例2: canHandle
import com.sun.jersey.spi.container.ContainerRequest; //導入方法依賴的package包/類
@Override
public boolean canHandle(ContainerRequest request) {
MultivaluedMap<String, String> queryParams = request.getQueryParameters();
try {
String sig = getSignature(request, queryParams);
String exp = getExpiresOrDate(request, queryParams);
String key = getAccessKey(request, queryParams);
if (isNullOrEmpty(sig) || isNullOrEmpty(exp) || isNullOrEmpty(key)) {
return false;
}
return true;
} catch (NullPointerException ex) {
return false;
}
}
示例3: HttpRequestAdapter
import com.sun.jersey.spi.container.ContainerRequest; //導入方法依賴的package包/類
public HttpRequestAdapter(ContainerRequest containerRequest) {
this.containerRequest = containerRequest;
MultivaluedMap<String, String> queryParams = containerRequest.getQueryParameters();
for (Entry<String, List<String>> entry : queryParams.entrySet())
{
StringBuffer values = new StringBuffer();
for (String val : entry.getValue())
{
if (values.length()>0) {
values.append(",");
}
values.append(val);
}
this.queryParameters.put(entry.getKey(), values.toString());
}
}
示例4: getEnvParamFromRequest
import com.sun.jersey.spi.container.ContainerRequest; //導入方法依賴的package包/類
private String getEnvParamFromRequest(ContainerRequest request) {
if (request.getQueryParameters() != null && !request.getQueryParameters().isEmpty()
&& request.getQueryParameters().containsKey(
MultiEnvAware.ENVIRONMENT)) {
return request.getQueryParameters()
.get(MultiEnvAware.ENVIRONMENT).get(0);
}
return null;
}
示例5: filter
import com.sun.jersey.spi.container.ContainerRequest; //導入方法依賴的package包/類
@Override
public ContainerRequest filter(final ContainerRequest request) {
final MultivaluedMap<String, String> parameters = request.getQueryParameters();
if (containsUpperCase(parameters.keySet())) {
//rebuild URI
final URI lower = rebuildQuery(request.getRequestUri(), parameters);
request.setUris(request.getBaseUri(), lower);
}
return request;
}
示例6: filter
import com.sun.jersey.spi.container.ContainerRequest; //導入方法依賴的package包/類
@Override
public ContainerRequest filter(final ContainerRequest request) {
final MultivaluedMap<String, String> parameters =
request.getQueryParameters();
if (containsUpperCase(parameters.keySet())) {
//rebuild URI
final URI lower = rebuildQuery(request.getRequestUri(), parameters);
request.setUris(request.getBaseUri(), lower);
}
return request;
}
示例7: addQueryParameters
import com.sun.jersey.spi.container.ContainerRequest; //導入方法依賴的package包/類
private void addQueryParameters(ContainerRequest cReq) {
MultivaluedMap<String, String> params = cReq.getQueryParameters();
for (Entry<String, List<String>> e : params.entrySet()) {
StaashRequestContext.addContext("Q__" + e.getKey(), e.getValue().toString());
}
}