View Javadoc

1   /*
2    * Copyright 1999-2001,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.commons.latka.servlet;
18  
19  import java.io.IOException;
20  import java.io.PrintWriter;
21  
22  import java.net.URL;
23  
24  import javax.servlet.http.HttpServlet;
25  import javax.servlet.http.HttpServletRequest;
26  import javax.servlet.http.HttpServletResponse;
27  
28  import org.apache.commons.latka.Suite;
29  
30  /**
31   * A servlet to view the Latka Suite
32   *
33   * @author Morgan Delagrange
34   * @version $Id: ViewSuiteServlet.java 155424 2005-02-26 13:09:29Z dirkv $
35   */
36  public class ViewSuiteServlet extends HttpServlet {
37    
38      /**
39       * perform a get request
40       *
41       * @param req the http request
42       * @param res the http response
43       * @throws IOException when an error occurs writing the response
44       */
45      public void doPost(HttpServletRequest req, HttpServletResponse res) 
46          throws IOException {
47          doGet(req, res);
48      }
49  
50      /**
51       * Perform a get request
52       *
53       * @param req the http request
54       * @param res the http response
55       * @throws IOException when an error occurs writing the response
56       */
57      public void doGet(HttpServletRequest req, HttpServletResponse res) 
58          throws IOException {
59  
60          res.setHeader("Content-type", "text/xml");
61          
62          String suiteUrl = req.getParameter("url");
63          Suite suite = new Suite(new URL(suiteUrl));
64  
65          PrintWriter writer = res.getWriter();
66          writer.print("not yet implemented");
67    }
68  
69  }