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

  • Home
  • SEARCH
  • 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 7876609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:11:35+00:00 2026-06-03T03:11:35+00:00

I started learning jsp and I am seeing that, if we want to print

  • 0

I started learning jsp and I am seeing that, if we want to print something in jsp,we have to write out.println() instead of System.out.println(), but if we write System.out.println() it does not show any error but does not o/p to the browser also. I want to know why it happens? As all we know that System is a predefined class and out is the output stream connected to the console. So why we do not require to write System in jsp?
Thanks.

  • 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-03T03:11:36+00:00Added an answer on June 3, 2026 at 3:11 am

    Because the out we’re referring to isn’t System.out, it’s a variable in the effective method that wraps our JSP page. System.out writes to the servlet container’s console (usually a log file); out is a different class entirely which writes to the output stream for the generated response.

    When a JSP is turned into code, it (in theory, and with Tomcat, in fact) goes through two steps: JSP -> servlet source code, then servlet source code -> class. The entire page is put inside a method, which with Tomcat looks something like this:

    public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {
    
        PageContext pageContext = null;
        HttpSession session = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        JspWriter _jspx_out = null;
        PageContext _jspx_page_context = null;
    
        try {
            response.setContentType("text/html");
            pageContext = _jspxFactory.getPageContext(this, request, response,
                      "qdforumerror.jsp", true, 65536, true);
            _jspx_page_context = pageContext;
            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();
            _jspx_out = out;
    
            /* =============================================
               ...your <% ... %> JSP code here, with
               any markup outside those tags converted into
               out.print("..."); statments...
               =============================================
            */
        }
        catch (Throwable t) {
            if (!(t instanceof SkipPageException)){
                out = _jspx_out;
                if (out != null && out.getBufferSize() != 0)
                    try { out.clearBuffer(); } catch (java.io.IOException e) {}
                if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
            }
          }
          finally {
              _jspxFactory.releasePageContext(_jspx_page_context);
        }
    }
    

    As you can see, out is a variable within that method, of type JspWriter (rather than OutputStream as with System.out).

    (Side note: Code you include in <%! ... %> tags rather than the normal <% ... %> tags isn’t put in the method; it’s put elsewhere in the generated servlet class.)

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

Sidebar

Related Questions

I am just starting out learning Java, GAE etc. I have started a project
I started learning OOP applied to C++. Now I want to know if I
I have just started learning python version 3 and trying to create a file
I have only started learning python recently. I would still be considered a beginner.
I have just started learning GWT. My question is pretty simple: If I create
I started learning LISP and I heard that there is some kind of a
Just started learning Rails (3). I am tearing my hair out trying to find
Just started learning PySide and is having problem with QTimer I have this #!/usr/bin/python
I started learning Delphi two days ago but I got stuck. I broke down
I started learning html recently, and one thing that really confused me is why

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.