Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21D5617C10 for ; Wed, 8 Apr 2015 16:55:04 +0000 (UTC) Received: (qmail 84294 invoked by uid 500); 8 Apr 2015 16:55:01 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 84224 invoked by uid 500); 8 Apr 2015 16:55:01 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 84195 invoked by uid 99); 8 Apr 2015 16:55:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 16:55:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DD185E10FD; Wed, 8 Apr 2015 16:55:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6337] Redirection via the injected servlet context Date: Wed, 8 Apr 2015 16:55:00 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 51bc2f2e4 -> cfdd73b74 [CXF-6337] Redirection via the injected servlet context Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cfdd73b7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cfdd73b7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cfdd73b7 Branch: refs/heads/3.0.x-fixes Commit: cfdd73b7430cb31b625b50a43dd386a2ca3ab749 Parents: 51bc2f2 Author: Sergey Beryozkin Authored: Wed Apr 8 17:53:29 2015 +0100 Committer: Sergey Beryozkin Committed: Wed Apr 8 17:54:31 2015 +0100 ---------------------------------------------------------------------- .../jaxrs/impl/tl/RequestDispatcherImpl.java | 49 ++++++++++++++++++++ .../impl/tl/ThreadLocalServletContext.java | 8 +++- .../jaxrs/interceptor/JAXRSOutInterceptor.java | 4 +- .../transport/http/AbstractHTTPDestination.java | 2 +- 4 files changed, 58 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/cfdd73b7/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/RequestDispatcherImpl.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/RequestDispatcherImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/RequestDispatcherImpl.java new file mode 100644 index 0000000..fd6000e --- /dev/null +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/RequestDispatcherImpl.java @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.jaxrs.impl.tl; + +import java.io.IOException; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.apache.cxf.jaxrs.utils.JAXRSUtils; + +class RequestDispatcherImpl implements RequestDispatcher { + private RequestDispatcher rd; + + RequestDispatcherImpl(RequestDispatcher rd) { + this.rd = rd; + } + + @Override + public void forward(ServletRequest request, ServletResponse response) throws ServletException, + IOException { + rd.forward(request, response); + JAXRSUtils.getCurrentMessage().getExchange().put("http.request.redirected", Boolean.TRUE); + } + + @Override + public void include(ServletRequest request, ServletResponse response) throws ServletException, + IOException { + rd.include(request, response); + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/cfdd73b7/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletContext.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletContext.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletContext.java index 54734c3..b1c6eaf 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletContext.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletContext.java @@ -79,7 +79,11 @@ public class ThreadLocalServletContext extends AbstractThreadLocalProxy