Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 1.3 KB

README.md

File metadata and controls

27 lines (21 loc) · 1.3 KB

Build Status:

Build Status

SMServlet - Self Mapped Servlet - allows user to easily map incoming http requests to servlet's methods by using annotations similar to this:

@RequestMapping(value="data/getUser/{id}", responseFormat=Format.JSON)
public Object getUser(@PathVariable("id") String id) {
   User user = getUserByIdFromSomewhere(id);
   return user;
}

The mapping itself is inspired by Spring MVC @RequestMapping. The motivation is to have such mechanism without having to use whole spring mvc as well as when being limited by using older servlet specification 2.5.

Additionally to the request mapping, smServlet does something extra:

  • deserialization of attributes from JSON (using gson)
  • serialization of response to JSON (using gson)
  • contains mechanism to add custom serialization and deserialization formats
  • allows to implement custom logic of handling of a response
  • allows to implement custom logic of request authorization
  • support for downloading respose as a file (attachment)
  • see documentation, guide and examples
  • see installation and quick start guide for getting started