Switching to ResourceConfig

This commit is contained in:
Luca Frosini 2024-05-30 11:50:56 +02:00
parent 2930a89ee7
commit 254b2f6722
2 changed files with 22 additions and 7 deletions

View File

@ -6,12 +6,7 @@
<display-name>${project.name}</display-name> <display-name>${project.name}</display-name>
<description>${project.description}</description> <description>${project.description}</description>
<servlet> <servlet>
<servlet-name>service</servlet-name> <servlet-name>org.gcube.resourcemanagement.RMInitializer</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>org.gcube.resourcemanagement.rest</param-value>
</init-param>
</servlet> </servlet>
<servlet-mapping> <servlet-mapping>
<servlet-name>default</servlet-name> <servlet-name>default</servlet-name>
@ -22,7 +17,7 @@
<url-pattern>/api-docs/*</url-pattern> <url-pattern>/api-docs/*</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet-mapping> <servlet-mapping>
<servlet-name>service</servlet-name> <servlet-name>org.gcube.resourcemanagement.RMInitializer</servlet-name>
<url-pattern>/*</url-pattern> <url-pattern>/*</url-pattern>
</servlet-mapping> </servlet-mapping>
</web-app> </web-app>

View File

@ -0,0 +1,20 @@
package org.gcube.resourcemanagement;
import javax.ws.rs.ApplicationPath;
import org.gcube.resourcemanagement.rest.BaseREST;
import org.gcube.smartgears.annotations.ManagedBy;
import org.glassfish.jersey.server.ResourceConfig;
/**
* @author Luca Frosini (ISTI - CNR)
*/
@ApplicationPath("/")
@ManagedBy(ResourceManager.class)
public class RMInitializer extends ResourceConfig {
public RMInitializer() {
packages(BaseREST.class.getPackage().toString());
}
}