src/main/java/js/servlet/AppServlet.java
@Override
	protected void service(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException {
		// push context path and remote address of the requested processed by this thread to logger diagnostic context
		logContext.put(LOG_CONTEXT_APP, httpRequest.getContextPath().isEmpty() ? TinyContainer.ROOT_CONTEXT : httpRequest.getContextPath().substring(1));
		logContext.put(LOG_CONTEXT_IP, httpRequest.getRemoteHost());
		logContext.put(LOG_CONTEXT_ID, Integer.toString(requestID.getAndIncrement(), Character.MAX_RADIX));
		if (isEmptyUriRequest(httpRequest)) {
			log.debug("Empty URI request for |%s|. Please check for <img> with empty 'src' or <link>, <script> with empty 'href' in HTML source or script resulting in such condition.", httpRequest.getRequestURI());
			return;
		}
		String requestURI = httpRequest.getRequestURI();

		long start = System.currentTimeMillis();
		Factory.bind(container);

		// request context has THREAD scope and this request thread may be reused by servlet container
		// takes care to properly initialize request context for every HTTP request
		RequestContext context = container.getInstance(RequestContext.class);
		context.attach(httpRequest, httpResponse);
		log.trace("Processing request |%s|.", requestURI);

		try {
			handleRequest(context);
		} catch (IOException | ServletException | Error | RuntimeException t) {
			// last line of defense; dump request context and throwable then dispatch exception to servlet container
			// servlet container will generate response page using internal templates or <error-page>, if configured
			dumpError(context, t);
			throw t;
		} finally {
			log.trace("%s %s processed in %d msec.", httpRequest.getMethod(), context.getRequestURL(), System.currentTimeMillis() - start);
			// cleanup remote address from logger context and detach request context instance from this request
			logContext.clear();
			context.detach();
		}
	}
@Override
	protected void service(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException {
		// push context path and remote address of the requested processed by this thread to logger diagnostic context
		logContext.put(LOG_CONTEXT_APP, httpRequest.getContextPath().isEmpty() ? TinyContainer.ROOT_CONTEXT : httpRequest.getContextPath().substring(1));
		logContext.put(LOG_CONTEXT_IP, httpRequest.getRemoteHost());
		logContext.put(LOG_CONTEXT_ID, Integer.toString(requestID.getAndIncrement(), Character.MAX_RADIX));
		if (isEmptyUriRequest(httpRequest)) {
			log.debug("Empty URI request for |%s|. Please check for <img> with empty 'src' or <link>, <script> with empty 'href' in HTML source or script resulting in such condition.", httpRequest.getRequestURI());
			return;
		}
		String requestURI = httpRequest.getRequestURI();

		long start = System.currentTimeMillis();
		Factory.bind(container);

		// request context has THREAD scope and this request thread may be reused by servlet container
		// takes care to properly initialize request context for every HTTP request
		RequestContext context = container.getInstance(RequestContext.class);
		context.attach(httpRequest, httpResponse);
		log.trace("Processing request |%s|.", requestURI);

		try {
			handleRequest(context);
		} catch (IOException | ServletException | Error | RuntimeException t) {
			// last line of defense; dump request context and throwable then dispatch exception to servlet container
			// servlet container will generate response page using internal templates or <error-page>, if configured
			dumpError(context, t);
			throw t;
		} finally {
			log.trace("%s %s processed in %d msec.", httpRequest.getMethod(), context.getRequestURL(), System.currentTimeMillis() - start);
			// cleanup remote address from logger context and detach request context instance from this request
			logContext.clear();
			context.detach();
		}
	}
@ Override protected void service ( HttpServletRequest httpRequest , HttpServletResponse httpResponse ) throws IOException , ServletException { // push context path and remote address of the requested processed by this thread to logger diagnostic context
 logContext . put ( LOG_CONTEXT_APP , httpRequest . getContextPath ( ) . isEmpty ( ) ? TinyContainer . ROOT_CONTEXT : httpRequest . getContextPath ( ) . substring ( 1 ) ) ; logContext . put ( LOG_CONTEXT_IP , httpRequest . getRemoteHost ( ) ) ; logContext . put ( LOG_CONTEXT_ID , Integer . toString ( requestID . getAndIncrement ( ) , Character . MAX_RADIX ) ) ; if ( isEmptyUriRequest ( httpRequest ) ) { log . debug ( "Empty URI request for |%s|. Please check for <img> with empty 'src' or <link>, <script> with empty 'href' in HTML source or script resulting in such condition." , httpRequest . getRequestURI ( ) ) ; return ; } String requestURI = httpRequest . getRequestURI ( ) ; long start = System . currentTimeMillis ( ) ; Factory . bind ( container ) ; // request context has THREAD scope and this request thread may be reused by servlet container
 // takes care to properly initialize request context for every HTTP request
 RequestContext context = container . getInstance ( RequestContext . class ) ; context . attach ( httpRequest , httpResponse ) ; log . trace ( "Processing request |%s|." , requestURI ) ; try { handleRequest ( context ) ; } catch ( IOException | ServletException | Error | RuntimeException t ) { // last line of defense; dump request context and throwable then dispatch exception to servlet container
 // servlet container will generate response page using internal templates or <error-page>, if configured
 dumpError ( context , t ) ; throw t ; } finally { log . trace ( "%s %s processed in %d msec." , httpRequest . getMethod ( ) , context . getRequestURL ( ) , System . currentTimeMillis ( ) - start ) ; // cleanup remote address from logger context and detach request context instance from this request
 logContext . clear ( ) ; context . detach ( ) ; } }
Prepare execution context and delegates the actual HTTP request processing to abstract handler. Initialize request
context bound to current thread and delegates {@link #handleRequest(RequestContext)}. After request handler execution
takes care to cleanup request context.
<p>
This method also initialize logger context, see {@link #logContext} with remote address of current request so that
logging utility can include contextual diagnostic data into log messages. Just before exiting, this service request
cleanups the logger context.

@throws IOException if reading from request or writing to response fail.
@throws ServletException for fails on executing servlet container services.
Prepare execution context and delegates the actual HTTP request processing to abstract handler . Initialize request context bound to current thread and delegates { @link #handleRequest ( RequestContext ) } . After request handler execution takes care to cleanup request context . <p > This method also initialize logger context see { @link #logContext } with remote address of current request so that logging utility can include contextual diagnostic data into log messages . Just before exiting this service request cleanups the logger context .