ro.isdc.wro.model.resource.locator.support
Class DispatcherStreamLocator

java.lang.Object
  extended by ro.isdc.wro.model.resource.locator.support.DispatcherStreamLocator

public class DispatcherStreamLocator
extends Object

Responsible to locate a context relative resource. Attempts to locate the resource using RequestDispatcher . If the dispatcher fails, it will fallback resource retrieval to a http call using UrlUriLocator.

Author:
Alex Objelean

Field Summary
static String ATTRIBUTE_INCLUDED_BY_DISPATCHER
          Attribute indicating that the request is included from within a wro request cycle.
 
Constructor Summary
DispatcherStreamLocator()
           
 
Method Summary
 InputStream getInputStream(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String location)
          When using JBoss Portal and it has some funny quirks...actually a portal application have several small web application behind it.
static boolean isIncludedRequest(javax.servlet.http.HttpServletRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_INCLUDED_BY_DISPATCHER

public static final String ATTRIBUTE_INCLUDED_BY_DISPATCHER
Attribute indicating that the request is included from within a wro request cycle. This is required to prevent StackOverflowError.

Constructor Detail

DispatcherStreamLocator

public DispatcherStreamLocator()
Method Detail

getInputStream

public InputStream getInputStream(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  String location)
                           throws IOException
When using JBoss Portal and it has some funny quirks...actually a portal application have several small web application behind it. So when it intercepts a requests for portal then it start bombing the the application behind the portal with multiple threads (web requests) that are combined with threads for wro4j.

Returns:
a valid stream for required location. This method will never return a null.
Throws:
IOException - if the stream cannot be located at the specified location.

isIncludedRequest

public static boolean isIncludedRequest(javax.servlet.http.HttpServletRequest request)
Parameters:
request -
Returns:
true if the request is included from within wro request cycle.


Copyright © 2008-2013. All Rights Reserved.