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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:51:36+00:00 2026-05-27T10:51:36+00:00

Hi I am trying to print the list from servlet to web screen (jsp)

  • 0

Hi I am trying to print the list from servlet to web screen (jsp)
I am using log and it’s not working.
Is there anyway to do or am I using this wrong?

private static final Logger log = Logger.getLogger(TodoServiceServlet.class.getName());
.....
Todo tmp = pm.getObjectById(Todo.class, user.getEmail());
    System.out.println("user email: " + user.getEmail());

    if(tmp==null){

        log.info("You have not stored any todo lists yet");

    }else{
        System.out.println("user email is there?: " + tmp.getEmail());

        System.out.println("start printing");
        ArrayList<String> todolists = tmp.getList();
        if(todolists==null)
            System.out.println("Arraylist null");

        if(!todolists.isEmpty()){
            for(String t : todolists){
                System.out.println("In the list: " + t);
                log.info("You need to do: " + t);
            }
        }else{
            log.info("You have nothing to do chil out!");
        }
  • 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-27T10:51:37+00:00Added an answer on May 27, 2026 at 10:51 am

    System.out would print to “standard out” on the web server (usually the console) not to the screen. What you have to do is instead write to the HttpServletResponse

    so something like this:

    public void doGet(HttpServletRequest req, HttpServletResponse resp) {
        try {
            resp.getWriter().println("user email is there?: " + tmp.getEmail());
        } catch (IOException e) {
            // handle your error here
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm trying to make an ordered list print out from an array. This
I'm trying to print out a list of products on a page. This is
I'm trying to print the list created by the functions in this class- what
I'm trying to print list of files from current directory. I used @files =
I'm trying to print a list of 20 online blog articles, along with the
I am having issues trying to print a list in python. I want to
I am trying to print HTML with this JavaScript in the webview, however it
I am trying to print out true if there is such letter/word and false
I am trying to print line[4] if there are 4 items, or line [4]
I am trying to print a list of all the Conferences and for each

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.