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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:37:10+00:00 2026-06-09T02:37:10+00:00

In my JSP page I have DIV . <div id=100> ALI </div> When I

  • 0

In my JSP page I have DIV.

<div id="100">
ALI
</div>

When I click on this DIV…

$("#100").click(function(){

});

…I need to send the value of the id 100, to a servlet, so that the servlet makes some database java codes, and returns for example, either 1 or 0. How can I do that? and is this the proper way?

  • 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-09T02:37:11+00:00Added an answer on June 9, 2026 at 2:37 am

    Using Ajax, you should call your server using a URL similar to this:

    http://localhot:8080/youAppContext/yourServer?id=100
    

    Then, in the servler side, you should retrieve the value that will be in the request with the name “id”

    There are out there many tool as jQuery that can help you to do the Ajax petition.

    Edited

    Well, here you can find a very simple Ajax example using jQuery. In the example, instead call a file (test1.txt) you should invoke a URL (as I described above). Of course, you will need to write some JS code to build your URL (where id be a variable). Once task is done in servlet side, you can return whatever, for example: “done” and display or not this information the HTML as it is done in the example.

    Take a look to this Web, there are many links that can help you.

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

Sidebar

Related Questions

I have this DIV on my application jsp page which I need to inject
In my .jsp page I have <s:url id=ecu value=ecu-info-detail> <s:param name=id value=%{id}></s:param> <s:param name=ecuName
I have this strange behavior in my JSP page: I have two Integer variables
I have a jsp page, which imports another jsp. This import is wrapped into
I have a functional JSP page that accepts URL parameters and updates a table
I have a JSP page at an address like this: http://example.com/foo/bar/rawr/something.jsp When I output
I have a JSP page on which I have a div tag in which
I have a JSP page that renders a block of HTML. In normal usage,
This could be a repeat question, I apologize. I have a jsp page in
I have a for loop on a JSP page to display a div containing

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.