Example usage for javax.servlet RequestDispatcher RequestDispatcher

List of usage examples for javax.servlet RequestDispatcher RequestDispatcher

Introduction

In this page you can find the example usage for javax.servlet RequestDispatcher RequestDispatcher.

Prototype

RequestDispatcher

Source Link

Usage

From source file:net.sf.jsptest.compiler.jsp20.mock.MockHttpServletRequest.java

public RequestDispatcher getRequestDispatcher(String path) {
    return new RequestDispatcher() {

        public void forward(ServletRequest request, ServletResponse response)
                throws ServletException, IOException {
        }//from   w w w.  j a  v  a 2 s  . c om

        public void include(ServletRequest request, ServletResponse response)
                throws ServletException, IOException {
        }
    };
}

From source file:org.directwebremoting.util.FakeHttpServletRequest.java

public RequestDispatcher getRequestDispatcher(String path) {
    return new RequestDispatcher() {
        /* (non-Javadoc)
         * @see javax.servlet.RequestDispatcher#include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         *///from  w ww.  ja v a  2s.c o m
        public void include(ServletRequest request, ServletResponse response)
                throws ServletException, IOException {
        }

        /* (non-Javadoc)
         * @see javax.servlet.RequestDispatcher#forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         */
        public void forward(ServletRequest request, ServletResponse response)
                throws ServletException, IOException {
        }
    };
}

From source file:wicket.protocol.http.MockServletContext.java

/**
 * Wicket does not use the RequestDispatcher, so this implementation just
 * returns a dummy value.//from  w w w  .j ava  2 s .  c  om
 * 
 * @param name
 *            The name of the resource to get the dispatcher for
 * @return The dispatcher
 */
public RequestDispatcher getRequestDispatcher(final String name) {
    return new RequestDispatcher() {
        public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException {
            servletResponse.getWriter().write("FORWARD TO RESOURCE: " + name);
        }

        public void include(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException {
            servletResponse.getWriter().write("INCLUDE OF RESOURCE: " + name);
        }
    };
}