Sometimes it can be usefull inject the Spring context in a legacy Servlet in order to automatically inject spring beans via @Autowired annotation. This can be easily done overriding the init method of HttpServlet and putting the statement SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this) in its implementation.

Read More →

The Java Servlet specification version 2.3 introduces a new component type, called a filter. A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. Filters typically do not themselves create responses, but instead provide universal functions that can be “attached” to any type of servlet or […]

Read More →