Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 885139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:51:37+00:00 2026-05-15T12:51:37+00:00

RequestDispatcher basically dispatches a request to some other resource i.e it doesn’t do a

  • 0

RequestDispatcher basically dispatches a request to some other resource i.e it doesn’t do a redirect but simply forwards the page to some page(resource). Thus browser’s history etc is not updated and the parameters that are available in request are still available on another page since we are not creating a new request using redirect.

What is equivalent of this in PHP? And also which function is used to redirect a page?

Thanks in advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:51:38+00:00Added an answer on May 15, 2026 at 12:51 pm

    There’s no direct equivalent.

    include and family are similar, but differ in several aspects:

    • The current state of the script is kept (any global variables, function and class definition, etc.)
    • A file path must be given

    Probably the most similar thing is an internal Apache subrequest (see virtual), but that has nothing to do with PHP itself. When PHP is invoked, the request has already been “dispatched”. Of course, you can, if you want, do a virtual “request dispatch logic” with PHP, which means sending all the requests to some initial script that then decides what to include/execute. This is what several frameworks do.

    To redirect a page, you manually send a header:

    header("{$_SERVER['SERVER_PROTOCOL']} $code"); //code can be 301, 302, 303, 307
    header("Location: $url");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I'm calling RequestDispatcher, instead of processing request, JSP page itself is being rendered
EDIT: found it at last. It doesn't work in Jetty for some reason, but
Is this possible? RequestDispatcher rd = request.getRequestDispatcher(index.html); rd.forward(request, response);
I have an HTTP Request Dispatcher class that works most of the time, but
I want to intercept a request using the RequestDispatcher, and then I want to
I want to send array of my own objects to JSP page by request.
I need to include a GWT file into JSP page. The GWT resource is
I'm trying to include a jsp page from a servlet: RequestDispatcher rd = ctx.getRequestDispatcher(
I want to pass some values from database to populate a page with various
What is the difference between request.sendRedirect() and requestDispatcher.forward() in terms of request parameters?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.