Example usage for javax.servlet.http HttpServletRequest getDispatcherType

List of usage examples for javax.servlet.http HttpServletRequest getDispatcherType

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequest getDispatcherType.

Prototype

public DispatcherType getDispatcherType();

Source Link

Document

Gets the dispatcher type of this request.

Usage

From source file:org.siphon.d2js.D2jsRunner.java

public String getServletPath(HttpServletRequest request) {
    // FORWARD,  INCLUDE,  REQUEST,  ASYNC,  ERROR
    if (request.getDispatcherType() == DispatcherType.REQUEST) {
        return request.getServletPath();
    } else if (request.getDispatcherType() == DispatcherType.INCLUDE) {
        return (String) request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
    } else {//w w w  . jav  a  2  s  .com
        return request.getServletPath(); // not sure
    }
}