Add pom.xml dependencies.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hacka2018</groupId>
<artifactId>hacka-mnl</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>hacka-mnl Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.27</version>
</dependency>
<!--dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-cdi2-se</artifactId>
<version>2.27</version>
</dependency-->
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>project</artifactId>
<version>2.27</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<finalName>hacka-mnl</finalName>
</build>
</project>
Setup web.xml
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Account Manager Service</display-name>
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.hacka.manila</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
Create sample class.
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
* @author robinsonmago
* url : http://localhost:8080/hacka-mnl/rest/account-officer/notify-logon
*
*/
@Path("/account-officer")
public class FinastraActMgr {
@GET
@Path("/notify-logon")
@Produces(MediaType.APPLICATION_JSON)
public String notifyLogon(){
CustomerStatusMgr.getInstance();
CustomerStatusMgr.logon();
return "{updateStatus:S}";
}//end method
@GET
@Path("/notify-logout")
@Produces(MediaType.APPLICATION_JSON)
public String notifyLogoout(){
CustomerStatusMgr.getInstance();
CustomerStatusMgr.logout();
return "{updateStatus:S}";
}//end method
}//end class
Add server dependencies.
Start the server and access the URL.
http://localhost:8080/hacka-mnl/rest/account-officer/notify-logon