How to use servlet with OSGi
问题 I want to create and deploy a web service to OSGi container. For example, publish the service to the address: http://localhost:8080/testservice. The service generate HTML response in a servlet. I have searched a lot and got: public class HelloWorldServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>");