use of org.apache.felix.http.base.internal.dispatch.RequestInfo in project felix by apache.
the class ServletContextImpl method getNamedDispatcher.
@Override
public RequestDispatcher getNamedDispatcher(final String name) {
if (name == null) {
return null;
}
final RequestDispatcher dispatcher;
final ServletHandler servletHandler = this.handlerRegistry.resolveServletByName(name);
if (servletHandler != null) {
final ServletResolution resolution = new ServletResolution();
resolution.handler = servletHandler;
resolution.handlerRegistry = this.handlerRegistry;
// TODO - what is the path of a named servlet?
final RequestInfo requestInfo = new RequestInfo("", null, null, null);
dispatcher = new RequestDispatcherImpl(resolution, requestInfo);
} else {
dispatcher = null;
}
return dispatcher;
}
use of org.apache.felix.http.base.internal.dispatch.RequestInfo in project felix by apache.
the class SharedServletContextImpl method getRequestDispatcher.
@Override
public RequestDispatcher getRequestDispatcher(String path) {
// See section 9.1 of Servlet 3.x specification...
if (path == null || (!path.startsWith("/") && !"".equals(path))) {
return null;
}
String query = null;
int q = 0;
if ((q = path.indexOf('?')) > 0) {
query = path.substring(q + 1);
path = path.substring(0, q);
}
// TODO remove path parameters...
final String encodedRequestURI = path == null ? "" : removeDotSegments(path);
final String requestURI = decodePath(encodedRequestURI);
final RequestDispatcher dispatcher;
final PathResolution pathResolution = this.registry.resolve(requestURI);
if (pathResolution != null) {
final ServletResolution resolution = new ServletResolution();
resolution.handler = pathResolution.handler;
resolution.handlerRegistry = this.registry;
final RequestInfo requestInfo = new RequestInfo(pathResolution.servletPath, pathResolution.pathInfo, query, UriUtils.concat(this.contextPath, encodedRequestURI));
dispatcher = new RequestDispatcherImpl(resolution, requestInfo);
} else {
dispatcher = null;
}
return dispatcher;
}
use of org.apache.felix.http.base.internal.dispatch.RequestInfo in project felix by apache.
the class ServletContextImpl method getRequestDispatcher.
@Override
public RequestDispatcher getRequestDispatcher(String path) {
// See section 9.1 of Servlet 3.x specification...
if (path == null || (!path.startsWith("/") && !"".equals(path))) {
return null;
}
String query = null;
int q = 0;
if ((q = path.indexOf('?')) > 0) {
query = path.substring(q + 1);
path = path.substring(0, q);
}
// TODO remove path parameters...
final String encodedRequestURI = path == null ? "" : removeDotSegments(path);
final String requestURI = decodePath(encodedRequestURI);
final RequestDispatcher dispatcher;
final PathResolution pathResolution = this.handlerRegistry.resolve(requestURI);
if (pathResolution != null) {
final ServletResolution resolution = new ServletResolution();
resolution.handler = pathResolution.handler;
resolution.handlerRegistry = this.handlerRegistry;
final RequestInfo requestInfo = new RequestInfo(pathResolution.servletPath, pathResolution.pathInfo, query, UriUtils.concat(this.getContextPath(), encodedRequestURI));
dispatcher = new RequestDispatcherImpl(resolution, requestInfo);
} else {
dispatcher = null;
}
return dispatcher;
}
use of org.apache.felix.http.base.internal.dispatch.RequestInfo in project felix by apache.
the class SharedServletContextImpl method getNamedDispatcher.
@Override
public RequestDispatcher getNamedDispatcher(final String name) {
if (name == null) {
return null;
}
final RequestDispatcher dispatcher;
final ServletHandler servletHandler = this.registry.resolveServletByName(name);
if (servletHandler != null) {
final ServletResolution resolution = new ServletResolution();
resolution.handler = servletHandler;
resolution.handlerRegistry = this.registry;
// TODO - what is the path of a named servlet?
final RequestInfo requestInfo = new RequestInfo("", null, null, null);
dispatcher = new RequestDispatcherImpl(resolution, requestInfo);
} else {
dispatcher = null;
}
return dispatcher;
}
Aggregations