留言板

Servlet with Osgi bundle

thumbnail
Jitendra Rajput,修改在7 年前。

Servlet with Osgi bundle

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
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,修改在7 年前。

RE: Servlet with Osgi bundle

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在6 年前。

RE: Servlet with Osgi bundle

New Member 发布: 1 加入日期: 11-6-2 最近的帖子
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,修改在5 年前。

RE: Servlet with Osgi bundle

New Member 帖子: 11 加入日期: 17-7-13 最近的帖子
Thanks   Dani Jardi   .  It is worked for me .