top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How do I capture a request and dispatch the exact request (with all the parameters received) to another URL?

+1 vote
386 views
How do I capture a request and dispatch the exact request (with all the parameters received) to another URL?
posted Nov 30, 2015 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

As far as i know it depends on the location of the next target url.
If the next servlet url is in the same host, then you can use the forward method.
Here is an example code about using forward:

               RequestDispatcher rd = null;
               String targetURL = "target_servlet_name";
               ServletContext ctx = this.getServletContext();
               rd = ctx.getRequestDispatcher(targetURL);
               rd.forward(request, response);
answer Dec 8, 2015 by Karthick.c
...