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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:20:03+00:00 2026-06-18T00:20:03+00:00

So, yeah, I summed up all what I understood and drew a simple diagram.

  • 0

enter image description here

So, yeah, I summed up all what I understood and drew a simple diagram.

If I am not wrong, the servlet is the CGI (Common Gateway Interface) because the servelet is THE ONLY way you can get access to the resources on the server. So, in short, it is the COMMON GATEWAY.

The CONTAINER, like Apache Tomcat, is responsible for capturing the request sent by the user and sending it to the servlet.

What the user perceives is a dynamic webpage called web app.

This is what I learnt so far.

Have I learnt it correctly ?

  • 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-06-18T00:20:04+00:00Added an answer on June 18, 2026 at 12:20 am

    You are almost right. Here are typical workflows you can follow when working with plain servlets:

    Servlet renders page

    1. Servlet container find servlet that matches request URL

    2. doGet() or doPost() is called depending on HTTP method requested

    3. Servlet does some processing

    4. Response (HTML, XML, JSON, image…) is generated directly in the servlet and sent to the client using getOutputStream() or getWriter()

      PrintWriter out = response.getWriter();
      out.println("Hello World");
      

    JSP handles request

    1. Servlet container finds JSP matching request. You must understand that underneath each JSP is translated to some internal servlet

    2. This JSP is interpreted. Raw text is sent directly, Java code in scriptlets is executed

    3. JSP ends, request is done

    Servlet forwards to JSP

    1. Same as 1-3 in first scenario

    2. Servlet chooses JSP file and forwards to that JSP

    3. JSP file is then evaluated, it has access to some context (request attributes, session) that was passed by servlet

      RequestDispatcher dispatcher = getServletContext()
       .getRequestDispatcher("foo.jsp");
      dispatcher.forward(request, response);
      

    The last scenario is considered the best one as it does not mix business logic (servlet) and presentation (JSP).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

yeah, because GWT not support java.text.Collator (and java.util.Locale also) ;/ Any solutions?
Yeah, I know that apple does not recommend this, but can anyone give me
So yeah, Basically I drew something on a form using Graphics. Now if I
Yeah, I know, its common problem, but I cant solve it for last 3
So yeah, the question basically says it all. What do you gain when you
Yeah, the noob question of the century... But in all seriousness, I actually have
Yeah this is a pretty simple topic, but my form just isn't updating the
http://lesscss.org/ Yeah the language syntax looks cool, but are there any significant advantages? Because
Yeah, I know, this question's been asked/answered 34798796873.5 times. I looked through all 3
Yeah so ive tried lots of stuff but the output keeps coming out all

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.