+++ /dev/null
-/*\r
- * Copyright 2006-2008 the original author or authors.\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.springframework.osgi.samples.simplewebapp.servlet;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.ServletException;\r
-import javax.servlet.ServletOutputStream;\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-/**\r
- * A simple, "hellow world" service running inside OSGi.\r
- * \r
- * @author Costin Leau\r
- * \r
- */\r
-public class HelloOsgiWorldServlet extends HttpServlet {\r
-\r
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r
- addHelloWorld(resp, req.getMethod());\r
- }\r
-\r
- protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r
- addHelloWorld(resp, req.getMethod());\r
- }\r
-\r
- public String getServletInfo() {\r
- return "Simple Osgi World Servlet";\r
- }\r
-\r
- private void addHelloWorld(HttpServletResponse response, String method) throws IOException {\r
- response.setContentType("text/html");\r
-\r
- ServletOutputStream out = response.getOutputStream();\r
- out.println("<html>");\r
- out.println("<head><title>Hello Osgi World</title></head>");\r
- out.println("<body>");\r
- out.println("<h1>Hello OSGi World</h1>");\r
- out.println("<h2>http method used:" + method + "</h2>");\r
- out.println("</body></html>");\r
- }\r
-}\r