1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 * 9 * http://www.apache.org/licenses/LICENSE-2.010 * 11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */17packageorg.apache.jetspeed.mocks;
1819import java.io.IOException;
2021import javax.servlet.Servlet;
22import javax.servlet.ServletException;
23import javax.servlet.ServletRequest;
24import javax.servlet.ServletResponse;
2526import com.mockrunner.mock.web.MockRequestDispatcher;
2728publicclassResourceLocatingRequestDispatcherextends MockRequestDispatcher
29 {
30protected Servlet servlet;
31protected String path;
32protected String info;
3334publicResourceLocatingRequestDispatcher(Servlet servlet, String path, String info)
35 {
36super();
37this.servlet = servlet;
38this.path = path;
39this.info = info;
40 }
4142publicvoid include(ServletRequest request, ServletResponse response) throws ServletException, IOException
43 {
44super.include(request, response);
4546 request.setAttribute("javax.servlet.include.servlet_path", this.path);
4748if (this.info != null)
49 request.setAttribute("javax.servlet.include.path_info", this.info);
5051this.servlet.service(request, response);
52 }
53 }