Forums de discussion
Servlet with Osgi bundle
Jitendra Rajput, modifié il y a 7 années.
Servlet with Osgi bundle
Liferay Master Publications: 875 Date d'inscription: 07/01/11 Publications récentes
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
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
David H Nebinger, modifié il y a 7 années.
RE: Servlet with Osgi bundle
Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
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, modifié il y a 6 années.
RE: Servlet with Osgi bundle
New Member Envoyer: 1 Date d'inscription: 02/06/11 Publications récentes
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
@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
Aravind L, modifié il y a 5 années.
RE: Servlet with Osgi bundle
New Member Publications: 11 Date d'inscription: 13/07/17 Publications récentes
Thanks Dani Jardi . It is worked for me .