Foros de discusión

Servlet with Osgi bundle

thumbnail
Jitendra Rajput, modificado hace 7 años.

Servlet with Osgi bundle

Liferay Master Mensajes: 875 Fecha de incorporación: 7/01/11 Mensajes recientes
Hi,

How can we create servlet with liferay osgi module ? Which service class to use and how to define URL pattern for servlet ?

I looked into liferay blade sample on github but i don't see any reference available for the same.

Any pointer on this issue would be appreciated.

Thanks !
Jitendra
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Servlet with Osgi bundle

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Just build your servlet into a war and deploy using the Liferay deploy folder. You'll be able to hit the servlet from the /o/your-servlet-context sort of path.
Dani Jardi, modificado hace 6 años.

RE: Servlet with Osgi bundle

New Member Mensaje: 1 Fecha de incorporación: 2/06/11 Mensajes recientes
Maybe this can be useful, it works for me in Liferay 7 / DXP

@Component(
immediate = true,
property = {
"osgi.http.whiteboard.context.path=/",
"osgi.http.whiteboard.servlet.name=my.package.name.myTest",
"osgi.http.whiteboard.servlet.pattern=/myTest/test",
},
service = Servlet.class)
public class myTest extends HttpServlet {
.......
}
Servlet URL : http://localhost:8080/o/myTest/test
thumbnail
Aravind L, modificado hace 5 años.

RE: Servlet with Osgi bundle

New Member Mensajes: 11 Fecha de incorporación: 13/07/17 Mensajes recientes
Thanks   Dani Jardi   .  It is worked for me .