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 6602743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:54:46+00:00 2026-05-25T18:54:46+00:00

When I called one servlet from another inside single if statement I was shocked,

  • 0

When I called one servlet from another inside single if statement I was shocked, that even if my forwarding method was called the flow didnt stopped and next methods were invoked (I had to put them into else statement to stop this).
How come? Does this mean that forward is asynchronous (if so, are there any more such a “tricky” methods)?

I’ve used “standard” forwarding: request.getRequestDispatcher(JSPFileName).forward(request, response);

  • 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-25T18:54:46+00:00Added an answer on May 25, 2026 at 6:54 pm

    No, it doesn’t mean it’s asynchronous. It just means that forward is a regular Java method, and that there’s no reason for the rest of the code not to execute. It’s just of your responsibility to avoid modifying the response after the request has been forwarded. But why wouldn’t the following code log everything to the standard output?

    System.out.println("About to forward the request to " + jspFileName + "...");
    long t0 = System.currentTimeMillis();
    request.getRequestDispatcher(jspFileName).forward(request, response);
    long t1 = System.currentTimeMillis();
    System.out.println("The forward took " + (t1 - t0) + " to complete");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code called from a servlet that calls out to an external service.
I have three files: one called sql.php witch has a class db that I
There are two databases in SQL Server 2005: One called A and another one
I have two methods, one called straight after another, which both throw the exact
I have two JSF <h:selectOneMenu> components. One called category another is subcategory . If
Lets say I have one table called REVIEWS This table has Reviews that customers
There is an initialization function on servlet level, init() method. It is called once,
So I have a file called one.txt that I have been modifying over the
I need to know order, my intents were called one by another. When I
Some guy called one of my Snipplr submissions crap because I used if ($_SERVER['REQUEST_METHOD']

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.