RestEasy Tutorial, CRUD Services example
This commit is contained in:
@@ -0,0 +1,535 @@
|
||||
|
||||
package com.baeldung;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "movie", propOrder = {
|
||||
"actors",
|
||||
"awards",
|
||||
"country",
|
||||
"director",
|
||||
"genre",
|
||||
"imdbID",
|
||||
"imdbRating",
|
||||
"imdbVotes",
|
||||
"language",
|
||||
"metascore",
|
||||
"plot",
|
||||
"poster",
|
||||
"rated",
|
||||
"released",
|
||||
"response",
|
||||
"runtime",
|
||||
"title",
|
||||
"type",
|
||||
"writer",
|
||||
"year"
|
||||
})
|
||||
public class Movie {
|
||||
|
||||
protected String actors;
|
||||
protected String awards;
|
||||
protected String country;
|
||||
protected String director;
|
||||
protected String genre;
|
||||
protected String imdbID;
|
||||
protected String imdbRating;
|
||||
protected String imdbVotes;
|
||||
protected String language;
|
||||
protected String metascore;
|
||||
protected String plot;
|
||||
protected String poster;
|
||||
protected String rated;
|
||||
protected String released;
|
||||
protected String response;
|
||||
protected String runtime;
|
||||
protected String title;
|
||||
protected String type;
|
||||
protected String writer;
|
||||
protected String year;
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� actors.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getActors() {
|
||||
return actors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� actors.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setActors(String value) {
|
||||
this.actors = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� awards.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getAwards() {
|
||||
return awards;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� awards.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setAwards(String value) {
|
||||
this.awards = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� country.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� country.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setCountry(String value) {
|
||||
this.country = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� director.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getDirector() {
|
||||
return director;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� director.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setDirector(String value) {
|
||||
this.director = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� genre.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� genre.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setGenre(String value) {
|
||||
this.genre = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� imdbID.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getImdbID() {
|
||||
return imdbID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� imdbID.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setImdbID(String value) {
|
||||
this.imdbID = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� imdbRating.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getImdbRating() {
|
||||
return imdbRating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� imdbRating.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setImdbRating(String value) {
|
||||
this.imdbRating = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� imdbVotes.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getImdbVotes() {
|
||||
return imdbVotes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� imdbVotes.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setImdbVotes(String value) {
|
||||
this.imdbVotes = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� language.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� language.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setLanguage(String value) {
|
||||
this.language = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� metascore.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getMetascore() {
|
||||
return metascore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� metascore.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setMetascore(String value) {
|
||||
this.metascore = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� plot.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getPlot() {
|
||||
return plot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� plot.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setPlot(String value) {
|
||||
this.plot = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� poster.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getPoster() {
|
||||
return poster;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� poster.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setPoster(String value) {
|
||||
this.poster = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� rated.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getRated() {
|
||||
return rated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� rated.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setRated(String value) {
|
||||
this.rated = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� released.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getReleased() {
|
||||
return released;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� released.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setReleased(String value) {
|
||||
this.released = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� response.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� response.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setResponse(String value) {
|
||||
this.response = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� runtime.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getRuntime() {
|
||||
return runtime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� runtime.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setRuntime(String value) {
|
||||
this.runtime = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� title.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� title.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setTitle(String value) {
|
||||
this.title = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� type.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� type.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setType(String value) {
|
||||
this.type = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� writer.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getWriter() {
|
||||
return writer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� writer.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setWriter(String value) {
|
||||
this.writer = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet� year.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet� year.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setYear(String value) {
|
||||
this.year = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.baeldung.client;
|
||||
|
||||
import com.baeldung.Movie;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
public interface ServicesInterface {
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getinfo")
|
||||
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
|
||||
Movie movieByImdbID(@QueryParam("imdbID") String imdbID);
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/addmovie")
|
||||
@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
|
||||
Response addMovie(Movie movie);
|
||||
|
||||
|
||||
@PUT
|
||||
@Path("/updatemovie")
|
||||
@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
|
||||
Response updateMovie(Movie movie);
|
||||
|
||||
|
||||
@DELETE
|
||||
@Path("/deletemovie")
|
||||
Response deleteMovie(@QueryParam("imdbID") String imdbID);
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/listmovies")
|
||||
@Produces({"application/json"})
|
||||
List<Movie> listMovies();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.baeldung.server.service;
|
||||
|
||||
import com.baeldung.Movie;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Path("/movies")
|
||||
public class MovieCrudService {
|
||||
|
||||
|
||||
private Map<String,Movie> inventory = new HashMap<String, Movie>();
|
||||
|
||||
@GET
|
||||
@Path("/getinfo")
|
||||
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
|
||||
public Movie movieByImdbID(@QueryParam("imdbID") String imdbID){
|
||||
|
||||
System.out.println("*** Calling getinfo ***");
|
||||
|
||||
Movie movie=new Movie();
|
||||
movie.setImdbID(imdbID);
|
||||
return movie;
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/addmovie")
|
||||
@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
|
||||
public Response addMovie(Movie movie){
|
||||
|
||||
System.out.println("*** Calling addMovie ***");
|
||||
|
||||
if (null!=inventory.get(movie.getImdbID())){
|
||||
return Response.status(Response.Status.NOT_MODIFIED)
|
||||
.entity("Movie is Already in the database.").build();
|
||||
}
|
||||
inventory.put(movie.getImdbID(),movie);
|
||||
|
||||
return Response.status(Response.Status.CREATED).build();
|
||||
}
|
||||
|
||||
|
||||
@PUT
|
||||
@Path("/updatemovie")
|
||||
@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
|
||||
public Response updateMovie(Movie movie){
|
||||
|
||||
System.out.println("*** Calling updateMovie ***");
|
||||
|
||||
if (null!=inventory.get(movie.getImdbID())){
|
||||
return Response.status(Response.Status.NOT_MODIFIED)
|
||||
.entity("Movie is not in the database.\nUnable to Update").build();
|
||||
}
|
||||
inventory.put(movie.getImdbID(),movie);
|
||||
return Response.status(Response.Status.OK).build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@DELETE
|
||||
@Path("/deletemovie")
|
||||
public Response deleteMovie(@QueryParam("imdbID") String imdbID){
|
||||
|
||||
System.out.println("*** Calling deleteMovie ***");
|
||||
|
||||
if (null==inventory.get(imdbID)){
|
||||
return Response.status(Response.Status.NOT_FOUND)
|
||||
.entity("Movie is not in the database.\nUnable to Delete").build();
|
||||
}
|
||||
|
||||
inventory.remove(imdbID);
|
||||
return Response.status(Response.Status.OK).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/listmovies")
|
||||
@Produces({"application/json"})
|
||||
public List<Movie> listMovies(){
|
||||
|
||||
return inventory.values().stream().collect(Collectors.toCollection(ArrayList::new));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.baeldung.server.service;
|
||||
|
||||
|
||||
import javax.ws.rs.ApplicationPath;
|
||||
import javax.ws.rs.core.Application;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Created by Admin on 29/01/2016.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ApplicationPath("/rest")
|
||||
public class RestEasyServices extends Application {
|
||||
|
||||
private Set<Object> singletons = new HashSet<Object>();
|
||||
|
||||
public RestEasyServices() {
|
||||
singletons.add(new MovieCrudService());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Object> getSingletons() {
|
||||
return singletons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Class<?>> getClasses() {
|
||||
return super.getClasses();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getProperties() {
|
||||
return super.getProperties();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xs:complexType name="movie">
|
||||
<xs:sequence>
|
||||
<xs:element name="actors" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="awards" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="country" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="director" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="genre" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="imdbID" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="imdbRating" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="imdbVotes" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="language" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="metascore" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="plot" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="poster" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="rated" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="released" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="response" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="runtime" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="title" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="type" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="writer" type="xs:string" minOccurs="0"/>
|
||||
<xs:element name="year" type="xs:string" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<configuration scan="true" scanPeriod="10 seconds">
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,16 @@
|
||||
<jboss-deployment-structure>
|
||||
<deployment>
|
||||
<exclude-subsystems>
|
||||
<subsystem name="resteasy" />
|
||||
</exclude-subsystems>
|
||||
|
||||
<exclusions>
|
||||
<module name="javaee.api" />
|
||||
<module name="javax.ws.rs.api"/>
|
||||
<module name="org.jboss.resteasy.resteasy-jaxrs" />
|
||||
</exclusions>
|
||||
|
||||
<local-last value="true" />
|
||||
</deployment>
|
||||
|
||||
</jboss-deployment-structure>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
|
||||
<jboss-web>
|
||||
</jboss-web>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||
|
||||
<display-name>RestEasy Example</display-name>
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<description>RestEasy Example</description>
|
||||
|
||||
<context-param>
|
||||
<param-name>webAppRootKey</param-name>
|
||||
<param-value>RestEasyExample</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<!-- this need same with resteasy servlet url-pattern -->
|
||||
<context-param>
|
||||
<param-name>resteasy.servlet.mapping.prefix</param-name>
|
||||
<param-value>/rest</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<servlet>
|
||||
<servlet-name>resteasy-servlet</servlet-name>
|
||||
<servlet-class>
|
||||
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
|
||||
</servlet-class>
|
||||
<init-param>
|
||||
<param-name>javax.ws.rs.Application</param-name>
|
||||
<param-value>com.baeldung.server.service.RestEasyServices</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>resteasy-servlet</servlet-name>
|
||||
<url-pattern>/rest/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
|
||||
</web-app>
|
||||
Reference in New Issue
Block a user