A lot of this can be explained by looking at the embedded examples.
https://github.com/eclipse/jetty.project/blob/master/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java

Ok ...
ServletContextHandler is your "web application"
SessionHandler is part of the ServletContextHandler, its kinda special, its
for the "web application" to use.

See ServletContextHandler.setSessionHandler()
http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/servlet/ServletContextHandler.html#setSessionHandler-org.eclipse.jetty.server.session.SessionHandler-

The DefaultHandler, GzipHandler, RequestLogHandler, and StatisticsHandler
are part of the server side.

GzipHandler and StatisticsHandler are HandlerWrappers, you want to wrap
them around what you are interested in.
RequestLogHandler is also a HandlerWrapper, but it can operate without
wrapping another Handler (this mode means that it operates on all behaviors
after it in the Handler tree)

You can use HandlerCollection, or HandlerList for this.
(ContextHandlerCollection is to group together multiple
ServletContextHandler or WebAppContext branches).

Your eventual tree might look like this ...

- StatisticsHandler (for all requests)
  - HandlerList
    - RequestLogHandler
    - GzipHandler (only for ServletContext)
      - ServletContextHandler
        - SessionHandler
        - Servlets
        - Filters
        - etc..
    - DefaultHandler (always last!)

Hope this helps ...

Joakim Erdfelt / [email protected]

On Wed, Sep 2, 2015 at 7:22 AM, Mullo, Jussi (Nokia - FI/Tampere) <
[email protected]> wrote:

> Hi,
>
> I’m somewhat confused on how to bolt all the Handlers together. For
> example my request log stays empty no matter what...
>
> These are my required Handlers (only one each):
>
>    - *ServletContextHandler*
>    - *SessionHandler*
>    - *DefaultHandler*
>    - *GzipHandler*
>    - *RequestLogHandler*
>    - *StatisticsHandler*
>
>
> Do I need to use *ContextHandlerCollection, HandlerCollection,
> HandlerList* and how?
>
> What should the Handler hierarchy look like when I finally call
> *server.getHandlers()* ?
>
> --
> Jussi
>
>
>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to