I want to create and deploy a web service in an OSGi container. For example, publish the service at:
http:
The service generates an HTML response in the servlet.
I 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>"); out.println("<head>"); out.println("<title>Hola</title>"); out.println("</head>"); out.println("<body bgcolor=\"white\">"); out.println("</body>"); out.println("</html>"); }
}
Tool I need to use:
The question is, I donโt know how to use Maven to create and implement such a web service, for example:
how to specify webapp / web.xml
how to specify pom.xml: dependencies, package type, plugin
how to register a service: implement BundlActivator or configure spring xml file
Can anyone help me with this? Is there a detailed tutorial for beginners?
java html maven servlets osgi
Li '
source share