Package com.cognifide.slice.core.internal.context

Examples of com.cognifide.slice.core.internal.context.ServletRequestContext


  public Context getServletRequestContext(final ServletRequest request, final ServletResponse response) {
    if (null == request || null == response) {
      return null;
    }

    final Context context = new ServletRequestContext(request);
    context.put(Key.get(ServletRequest.class), request);
    context.put(Key.get(ServletResponse.class), response);

    final Resource requestedResource = getRequestedResource(request);
    context.put(Key.get(Resource.class, RequestedResource.class), requestedResource);

    return context;
  }
View Full Code Here


      final ServletResponse response) {
    if (null == request || null == response) {
      throw new IllegalArgumentException("Request and response can't be null");
    }

    final Context context = new ServletRequestContext(injectorName, request);
    context.put(Key.get(ServletRequest.class), request);
    context.put(Key.get(ServletResponse.class), response);

    final Resource requestedResource = getRequestedResource(request);
    context.put(Key.get(Resource.class, RequestedResource.class), requestedResource);

    return context;
  }
View Full Code Here

TOP

Related Classes of com.cognifide.slice.core.internal.context.ServletRequestContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.