@Override public String extractApplicationPath(ServerHttpConnection connection) throws HttpException { return WebRouter.transformToApplicationCanonicalPath(connection.getRequest().getUri(), this.contextPath); }
@Override public Object execute(ManagedFunctionContext<NotFoundDependencies, None> context) throws NotFoundHttpException { // Obtain the request path ServerHttpConnection connection = (ServerHttpConnection) context .getObject(NotFoundDependencies.SERVER_HTTP_CONNECTION); String requestPath = connection.getRequest().getUri(); // Not found throw new NotFoundHttpException(requestPath); }
String path = connection.getRequest().getUri(); int endPathIndex = path.indexOf('?'); if (endPathIndex >= 0) {
/** * Services the {@link HttpRequest}. * * @param connection * {@link ServerHttpConnection}. * @param managedFunctionContext * {@link ManagedFunctionContext}. * @return <code>true</code> if {@link HttpRequest} was routed to a * {@link WebRouteHandler}. <code>false</code> indicates not * handled. */ public boolean service(ServerHttpConnection connection, ManagedFunctionContext<?, Indexed> managedFunctionContext) { // Obtain the request details HttpRequest request = connection.getRequest(); HttpMethod method = request.getMethod(); String requestUri = request.getUri(); // Attempt to match to a route for (int i = 0; i < this.nodes.length; i++) { WebRouteNode node = this.nodes[i]; // Determine if handled by node if (node.handle(method, requestUri, 0, null, connection, managedFunctionContext)) { return true; // servicing request } } // As here, not handling request return false; }
String requestUri = request.getUri();
@Override public void handle(HttpArgument pathArguments, ServerHttpConnection connection, ManagedFunctionContext<?, Indexed> context) { // Determine if secure connection is required if (this.isRequireSecure && (!connection.isSecure())) { // Non-secure, requiring secure - so redirect String path = connection.getRequest().getUri(); String securePath = connection.getServerLocation().createClientUrl(this.isRequireSecure, path); // Send redirect response to secure path HttpResponse response = connection.getResponse(); response.setStatus(HttpStatus.TEMPORARY_REDIRECT); response.getHeaders().addHeader(LOCATION, securePath); return; } // Undertake flow to service route context.doFlow(this.flowIndex, pathArguments, null); }
String uri = request.getUri(); if (!(this.inputPath.isMatchPath(uri, this.terminatingPathCharacter))) {