Posts

Showing posts with the label servlet

Servlet Filter in Liferay 7.2

Liferay 7.2 - Servlet Filter Sample Overview This article describes how to create a servlet filter in Liferay 7.2.  In this sample we'll create a filter for documents, which allows only admins to access the PDF files. Filter creation Create  service  Liferay module for the filter class. Define dependencies in  build.gradle  file: dependencies { compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel" compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib" compileOnly group: "javax.portlet", name: "portlet-api" compileOnly group: "javax.servlet", name: "javax.servlet-api" compileOnly group: "jstl", name: "jstl" compileOnly group: "org.osgi", name: "osgi.cmpn" } Define OSGi metadata in  bnd.bnd , sample: Bundle-Name: LifeDev Document Servlet Filter Bundle-SymbolicName: com.lifedev.docu...