本文整理汇总了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());
}
}