Public JAX-RS Application Implementation
Public JAX-RS Application Implementation Overview This article will explain how to create a JAX-RS REST application, which will be publicly accessible. Prerequisites Create a Liferay Gradle Workspace with a Target Platform enabled. JAX-RS Module Implementation Create a new ‘rest’ module: Created module structure: bnd.bnd file: Bundle-Name : liferay-jax-rs-sample Bundle-SymbolicName : com.liferay.jax.rs.sample Bundle-Version : 1.0.0 Liferay-Configuration-Path : /configuration build.gradle file: dependencies { compileOnly group: "javax.ws.rs" , name: "javax.ws.rs-api" compileOnly group: "org.osgi" , name: "org.osgi.service.component.annotations" compileOnly group: "org.osgi" , name: "org.osgi.service.jaxrs" } Once you deploy sample generated JAX-RS application, and try to access it by URL http://localhost:8080/o/greetings - you’ll see the “Access denied” error: ...