本文整理了Java中org.glassfish.grizzly.http.server.Request.getParameterNames
方法的一些代码示例,展示了Request.getParameterNames
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getParameterNames
方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Request
类名称:Request
方法名:getParameterNames
[英]Return the names of all defined request parameters for this request.
[中]返回此请求的所有已定义请求参数的名称。
代码示例来源:origin: opentripplanner/OpenTripPlanner
public OTPRequest (Request req, Graph graph) {
this.graph = graph;
for (String key : req.getParameterNames()) {
params.put(key, req.getParameter(key));
}
String path = req.getPathInfo();
sfmt = SerializeFormat.JSON;
if (req.getHeader("Accept").contains("application/xml")) {
sfmt = SerializeFormat.XML;
}
if (req.getHeader("Accept").contains("application/json")) {
sfmt = SerializeFormat.JSON;
}
if (path.endsWith(".xml")) {
path = path.substring(0, path.length() - 4);
sfmt = SerializeFormat.XML;
};
if (path.endsWith(".json")) {
path = path.substring(0, path.length() - 5);
sfmt = SerializeFormat.JSON;
};
parts = path.split("/");
// path always begins with a slash, so part 0 is empty
if (parts.length > 1) action = parts[1];
if (parts.length > 2) id = parts[2];
}
代码示例来源:origin: javaee/grizzly
@Override
public Set<String> run() {
return request.getParameterNames();
}
}
代码示例来源:origin: javaee/grizzly
@Override
public Set<String> run() {
return request.getParameterNames();
}
}
代码示例来源:origin: javaee/grizzly
@Override
public Set<String> run() {
return request.getParameterNames();
}
}
代码示例来源:origin: javaee/grizzly
@Override
public Set<String> run() {
return request.getParameterNames();
}
}
代码示例来源:origin: javaee/grizzly
@Override
public Set<String> run() {
return request.getParameterNames();
}
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
@Override
public Set<String> run() {
return request.getParameterNames();
}
}
代码示例来源:origin: org.glassfish.main.core/kernel
/**
*
*/
private void logRequest(Request req) {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "AdminConsoleAdapter''s STATE IS: {0}", getStateMsg());
logger.log(Level.FINE, "Current Thread: {0}", Thread.currentThread().getName());
for (final String name : req.getParameterNames()) {
final String values = Arrays.toString(req.getParameterValues(name));
logger.log(Level.FINE, "Parameter name: {0} values: {1}", new Object[]{name, values});
}
}
}
代码示例来源:origin: org.glassfish.main.web/web-core
/**
* Return the names of all defined request parameters for this request.
*/
@Override
public Enumeration<String> getParameterNames() {
/*
if (!requestParametersParsed) {
parseRequestParameters();
}
*/
processParameters();
return new Enumerator<String>(coyoteRequest.getParameterNames());
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Enumeration<String> getParameterNames() {
if (request == null) {
throw new IllegalStateException("Null request object");
}
if (System.getSecurityManager() != null){
return new Enumerator(AccessController.doPrivileged(
new GetParameterNamesPrivilegedAction()));
} else {
return new Enumerator(request.getParameterNames());
}
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Enumeration<String> getParameterNames() {
if (request == null) {
throw new IllegalStateException("Null request object");
}
if (System.getSecurityManager() != null){
return new Enumerator(AccessController.doPrivileged(
new GetParameterNamesPrivilegedAction()));
} else {
return new Enumerator(request.getParameterNames());
}
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Enumeration<String> getParameterNames() {
if (request == null) {
throw new IllegalStateException("Null request object");
}
if (System.getSecurityManager() != null){
return new Enumerator(AccessController.doPrivileged(
new GetParameterNamesPrivilegedAction()));
} else {
return new Enumerator(request.getParameterNames());
}
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Enumeration<String> getParameterNames() {
if (request == null) {
throw new IllegalStateException("Null request object");
}
if (System.getSecurityManager() != null){
return new Enumerator(AccessController.doPrivileged(
new GetParameterNamesPrivilegedAction()));
} else {
return new Enumerator(request.getParameterNames());
}
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Enumeration<String> getParameterNames() {
if (request == null) {
throw new IllegalStateException("Null request object");
}
if (System.getSecurityManager() != null){
return new Enumerator(AccessController.doPrivileged(
new GetParameterNamesPrivilegedAction()));
} else {
return new Enumerator(request.getParameterNames());
}
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Enumeration<String> getParameterNames() {
if (request == null) {
throw new IllegalStateException("Null request object");
}
if (System.getSecurityManager() != null){
return new Enumerator(AccessController.doPrivileged(
new GetParameterNamesPrivilegedAction()));
} else {
return new Enumerator(request.getParameterNames());
}
}
代码示例来源:origin: javaee/grizzly
/**
* Returns a {@link java.util.Map} of the parameters of this request.
* Request parameters are extra information sent with the request.
* For HTTP servlets, parameters are contained in the query string
* or posted form data.
*
* @return A {@link java.util.Map} containing parameter names as keys
* and parameter values as map values.
*/
public Map<String,String[]> getParameterMap() {
if (parameterMap.isLocked())
return parameterMap;
for (final String name : getParameterNames()) {
final String[] values = getParameterValues(name);
parameterMap.put(name, values);
}
parameterMap.setLocked(true);
return parameterMap;
}
代码示例来源:origin: javaee/grizzly
/**
* Returns a {@link java.util.Map} of the parameters of this request.
* Request parameters are extra information sent with the request.
* For HTTP servlets, parameters are contained in the query string
* or posted form data.
*
* @return A {@link java.util.Map} containing parameter names as keys
* and parameter values as map values.
*/
public Map<String,String[]> getParameterMap() {
if (parameterMap.isLocked())
return parameterMap;
for (final String name : getParameterNames()) {
final String[] values = getParameterValues(name);
parameterMap.put(name, values);
}
parameterMap.setLocked(true);
return parameterMap;
}
代码示例来源:origin: javaee/grizzly
/**
* Returns a {@link java.util.Map} of the parameters of this request.
* Request parameters are extra information sent with the request.
* For HTTP servlets, parameters are contained in the query string
* or posted form data.
*
* @return A {@link java.util.Map} containing parameter names as keys
* and parameter values as map values.
*/
public Map<String,String[]> getParameterMap() {
if (parameterMap.isLocked())
return parameterMap;
for (final String name : getParameterNames()) {
final String[] values = getParameterValues(name);
parameterMap.put(name, values);
}
parameterMap.setLocked(true);
return parameterMap;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
/**
* Returns a {@link java.util.Map} of the parameters of this request.
* Request parameters are extra information sent with the request.
* For HTTP servlets, parameters are contained in the query string
* or posted form data.
*
* @return A {@link java.util.Map} containing parameter names as keys
* and parameter values as map values.
*/
public Map<String,String[]> getParameterMap() {
if (parameterMap.isLocked())
return parameterMap;
for (final String name : getParameterNames()) {
final String[] values = getParameterValues(name);
parameterMap.put(name, values);
}
parameterMap.setLocked(true);
return parameterMap;
}
代码示例来源:origin: javaee/grizzly
/**
* Returns a {@link java.util.Map} of the parameters of this request.
* Request parameters are extra information sent with the request.
* For HTTP servlets, parameters are contained in the query string
* or posted form data.
*
* @return A {@link java.util.Map} containing parameter names as keys
* and parameter values as map values.
*/
public Map<String,String[]> getParameterMap() {
if (parameterMap.isLocked())
return parameterMap;
for (final String name : getParameterNames()) {
final String[] values = getParameterValues(name);
parameterMap.put(name, values);
}
parameterMap.setLocked(true);
return parameterMap;
}
内容来源于网络,如有侵权,请联系作者删除!