An alternative to complex web frameworks


Web tier: servlets, JSP, Web frameworks: An alternative to complex web frameworks

  1. An alternative to complex web frameworks (3 messages)

    I have found pipeline architectures to be one of the best ways of dividing up a problem. Unfortunately pipeline based frameworks seem extremely rare in the web world. I have come up with an extremely simple way to use pipelines that uses nothing but the core functionality of the servlet engine - a nonframework framework. Basically the idea is to use filters as pipeline components. I would be interested in feedback on this approach.

    Threaded Messages (3)

  2. Definitely works[ Go to top ]

    A year ago I created a very simplistic, Struts-like, MVC framework for an application. You essentially use a properties file to map URLs to sets of classes that are to be invoked in consecutive order - very much like a pipeline.
    You can use a filter or a servlet as the controller for such a setup to load the properties in the init() method and then map incoming requests to the correct pipeline.
  3. Definitely works[ Go to top ]

    I assume you used a custom interface for the processing classes. I find it is very difficult to implement a pipeline structure with servlets (as the components, not the controller) because the lookup mechanisms have all been deprecated (one servlet can not look up and call another servlet directly). It almost looks as if servlets were meant to be pipelined at one time, but then Sun explicitly disabled this ability.
  4. Definitely works[ Go to top ]

    As pipeline components I used plain Java classes. Each class was tasked with a single piece of functionality ('action'), and adhered to simple interface that had one method in it with one paramter:

    <code>doAction(HttpServletRequest request)<code>.

    Information was passed between actions as attributes of the HttpServletRequest object which at the end of the pipeline was passed to a JSP that was responsible for displaying the result of the operation.

    Tell me if you want more information.