本文整理了Java中org.eclipse.jetty.server.Request.mergeQueryParameters
方法的一些代码示例,展示了Request.mergeQueryParameters
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.mergeQueryParameters
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Request
类名称:Request
方法名:mergeQueryParameters
暂无
代码示例来源:origin: jenkinsci/winstone
public void handleAsync(HttpChannel channel) throws IOException, ServletException
{
final HttpChannelState state = channel.getRequest().getHttpChannelState();
final AsyncContextEvent event = state.getAsyncContextEvent();
final Request baseRequest=channel.getRequest();
final String path=event.getPath();
if (path!=null)
{
// this is a dispatch with a path
ServletContext context=event.getServletContext();
String query=baseRequest.getQueryString();
baseRequest.setURIPathQuery(URIUtil.addEncodedPaths(context==null?null:URIUtil.encodePath(context.getContextPath()), path));
HttpURI uri = baseRequest.getHttpURI();
baseRequest.setPathInfo(uri.getDecodedPath());
if (uri.getQuery()!=null)
baseRequest.mergeQueryParameters(query,uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
}
final String target=baseRequest.getPathInfo();
final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
if (LOG.isDebugEnabled())
LOG.debug("{} {} {} on {}", request.getDispatcherType(), request.getMethod(), target, channel);
handle(target, baseRequest, request, response);
if (LOG.isDebugEnabled())
LOG.debug("handledAsync={} async={} committed={} on {}", channel.getRequest().isHandled(),request.isAsyncStarted(),response.isCommitted(),channel);
}
代码示例来源:origin: Nextdoor/bender
public void handleAsync(HttpChannel<?> connection) throws IOException, ServletException
{
final HttpChannelState state = connection.getRequest().getHttpChannelState();
final AsyncContextEvent event = state.getAsyncContextEvent();
final Request baseRequest=connection.getRequest();
final String path=event.getPath();
if (path!=null)
{
// this is a dispatch with a path
ServletContext context=event.getServletContext();
HttpURI uri = new HttpURI(URIUtil.addPaths(context==null?null:context.getContextPath(), path));
baseRequest.setUri(uri);
baseRequest.setRequestURI(null);
baseRequest.setPathInfo(uri.getDecodedPath());
if (uri.getQuery()!=null)
baseRequest.mergeQueryParameters(uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
}
final String target=baseRequest.getPathInfo();
final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
if (LOG.isDebugEnabled())
{
LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection);
handle(target, baseRequest, request, response);
LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus());
}
else
handle(target, baseRequest, request, response);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
public void handleAsync(HttpChannel connection) throws IOException, ServletException
{
final HttpChannelState state = connection.getRequest().getHttpChannelState();
final AsyncContextEvent event = state.getAsyncContextEvent();
final Request baseRequest=connection.getRequest();
final String path=event.getPath();
if (path!=null)
{
// this is a dispatch with a path
ServletContext context=event.getServletContext();
String query=baseRequest.getQueryString();
baseRequest.setURIPathQuery(URIUtil.addPaths(context==null?null:context.getContextPath(), path));
HttpURI uri = baseRequest.getHttpURI();
baseRequest.setPathInfo(uri.getDecodedPath());
if (uri.getQuery()!=null)
baseRequest.mergeQueryParameters(query,uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
}
final String target=baseRequest.getPathInfo();
final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
if (LOG.isDebugEnabled())
{
LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection);
handle(target, baseRequest, request, response);
LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus());
}
else
handle(target, baseRequest, request, response);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
baseRequest.mergeQueryParameters(baseRequest.getQueryString(),attr._query, false);
baseRequest.setAttributes(attr);
代码示例来源:origin: Nextdoor/bender
baseRequest.mergeQueryParameters(_query, false);
baseRequest.setAttributes(attr);
代码示例来源:origin: jenkinsci/winstone
baseRequest.mergeQueryParameters(baseRequest.getQueryString(),attr._query, false);
baseRequest.setAttributes(attr);
代码示例来源:origin: Nextdoor/bender
baseRequest.setPathInfo(_uri);
if (_query!=null)
baseRequest.mergeQueryParameters(_query, true);
baseRequest.setAttributes(attr);
代码示例来源:origin: jenkinsci/winstone
baseRequest.setPathInfo(_pathInContext);
if (_uri.getQuery()!=null || old_uri.getQuery()!=null)
baseRequest.mergeQueryParameters(old_uri.getQuery(),_uri.getQuery(), true);
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
baseRequest.setPathInfo(_pathInContext);
if (_uri.getQuery()!=null || old_uri.getQuery()!=null)
baseRequest.mergeQueryParameters(old_uri.getQuery(),_uri.getQuery(), true);
内容来源于网络,如有侵权,请联系作者删除!