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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:44:03+00:00 2026-05-23T14:44:03+00:00

I am using RestfbApi to fetch my friends’ names and display on a web

  • 0

I am using RestfbApi to fetch my friends’ names and display on a web page. I also want a corresponding checkbox to each friend, since from the use of table tag , I have friend’s name as well as corresponding checkbox.
As I generated checkboxes dynamically , how to make sure which checkboxes are checked when my app runs. The scenario is if I checked five friends and press post to wall button, a wall should be post to all five friends. I know how to post a wall just want to know how to map user selected friends(checked ones) to java code.

protected void doGet(HttpServletRequest request, HttpServletResponse response) 
throws ServletException    
{


    User user = facebookClient.fetchObject("me", User.class);
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();


    String docType =
        "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
        "Transitional//EN\">\n";
        out.println(docType +
        "<HTML>\n" +
        "<HEAD><TITLE>Hello</TITLE></HEAD>\n" +
        "<BODY BGCOLOR=\"#FDF5E6\">\n" +
        "<H1></H1>\n" +
        "</BODY></HTML>");




 JsonObject accounts = facebookClient.fetchObject("me/friends",JsonObject.class);
                  JsonArray data = accounts.getJsonArray("data");

                for(int i = 0; i < data.length(); i++)
                      {
                     String id = data.getJsonObject(i).getString("id");
                 Double int1 = Double.parseDouble(id);
                     String strName = data.getJsonObject(i).getString("name");

                   out.println("<table>");                             

                             out.println("<tr><td> <input type='checkbox' name='wahtevername' value='"+int1 +"'>"+strName+" </td></tr>");  

                         out.println("</table>" );  

                       } 

                     }
 out.println(docType +"<form method=\"GET\">"+"<input type=\"submit\" value=\"Post to wall\" name=\"option\">"+"</form>");                         
  • 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-23T14:44:04+00:00Added an answer on May 23, 2026 at 2:44 pm

    Use request.gatParameterValues("whatevername") to get an array of the values of selected checkboxes.

    (Btw, it would be better to place the html code in JSP. Set the list as request attribute and then use JSTL’s <c:forEach> to iterate)

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

Sidebar

Related Questions

Using WebViewBrush I can render web page content (it's screen shot) to e.g. Rectangle
Using Java, how can I extract all the links from a given web page?
Using a populated Table Type as the source for a TSQL-Merge. I want to
Using WPF/PRISM I want to log my messages through ILoggerFacade to my GUI (A
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database
Using Java,I have to fetch multiple sets of values from an XML file to
Using MVVM. I have a DataTemplate which I am using to display an expander
Using interface builder, I want an a button that when clicked shows you a
Using javascript/jQuery: I have an array with images and I need to display them

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.