Pustike Web provides API for creating application using RESTful Web Services with a central servlet DispatcherServlet
, having an API similar to JAX-RS. Applications developed using this library can be deployed in any Servlet container like other web frameworks.
The WebServletContextListener
and a DispatcherServlet
need to be declared and mapped according to the Servlet specification by using Java configuration or in web.xml. During servlet context initialization, the dependency injector should be configured using the ServletModule
and other application specific modules. Application modules register resource controller classes annotated with @Path
specifying relative path to the context. The DispatcherServlet
delegates incoming client requests, by matching their request path pattern, to the respective controller class which does the actual processing.
Controller methods can retrieve data from the servlet request by declaring parameter annotations with respective keys. It also includes the JSON data reader/writer with java object mapping that supports option to use specified fields only, based on requested data context.
Following are some of its key features:
DispatcherServlet
with an API similar to JAX-RS.@Path
to specify the relative path.@GET
, @PUT
, @POST
, @DELETE
, @HEAD
.@Consumes
.@Produces
(used for content negotiation).@PathParam
, @QueryParam
, @BeanParam
, @CookieParam
, @FormParam
, @HeaderParam
, JsonParam
. A default value can be specified using @DefaultValue
which is used when the key is not found.RequestScope
and SessionScope
are made available for binding resource classes when configuring the injector.Documentation:
Download:
The most recent release is v0.8.0 (2021-01-25), and it is available from Maven central repository.
Download the latest-jar or configure this dependency in Maven build:
<dependency>
<groupId>io.github.pustike</groupId>
<artifactId>pustike-web</artifactId>
<version>0.8.0</version>
</dependency>
Or, download the latest JAR(~60kB) from Maven Central.
License: This library is published under the Apache License, Version 2.0