1 /*
2 * ========================================================================
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership.
7 * The ASF licenses this file to You under the Apache License, Version 2.0
8 * (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * ========================================================================
20 */
21 package org.apache.cactus.server;
22
23 import javax.servlet.ServletException;
24
25 import org.apache.cactus.internal.configuration.ConfigurationInitializer;
26 import org.apache.cactus.internal.server.JspImplicitObjects;
27 import org.apache.cactus.internal.server.JspTestController;
28 import org.apache.commons.logging.Log;
29 import org.apache.commons.logging.LogFactory;
30
31 /**
32 * Extension of the <code>jspRedirector.jsp</code> JSP Redirector in the java
33 * realm in order to provide a symmetry with the <code>ServletRedirector</code>
34 * and minimize the amount of java code in <code>jspRedirector.jsp</code>.
35 *
36 * @version $Id: JspTestRedirector.java 238991 2004-05-22 11:34:50Z vmassol $
37 */
38 public class JspTestRedirector
39 {
40 /**
41 * As this class is the first one loaded on the server side, we ensure
42 * that the Cactus configuration has been initialized. A better
43 * implementation might be to perform this initialization in the
44 * init() method. However, that requires removing the static LOGGER
45 * object.
46 */
47 static
48 {
49 ConfigurationInitializer.initialize();
50 }
51
52 /**
53 * The logger.
54 */
55 private static final Log LOGGER =
56 LogFactory.getLog(JspTestRedirector.class);
57
58 /**
59 * Handles requests from the <code>jspRedirector.jsp</code> JSP Redirector.
60 * @param theObjects the implicit objects that will be passed to the test
61 * case
62 * @exception ServletException if an error occurs servicing the request
63 */
64 public void doGet(JspImplicitObjects theObjects) throws ServletException
65 {
66 // Mark beginning of test on server side
67 LOGGER.debug("------------- Start JSP service");
68
69 JspTestController controller = new JspTestController();
70
71 controller.handleRequest(theObjects);
72 }
73 }