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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:15:04+00:00 2026-05-29T04:15:04+00:00

The servlet queries the database and throws data in to a file. This data

  • 0

The servlet queries the database and throws data in to a file.
This data file has to be refreshed every 10 seconds for users to view the updated information.

I need help with triggering servlet with javascript function. I am successful in getting the timeinterval method in JS but I am having issue calling the servlet.

var int=self.setInterval("trigger()",10000); 

function(){ 

    //Servlet queries the db and loads the data into the file. 
    trigger servlet ...??? 

    " TriggerServlet? ...... 

}
  • 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-29T04:15:05+00:00Added an answer on May 29, 2026 at 4:15 am
          var url = "servlet URL"; 
          var request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
          request.open("GET",url,true);
          request.send(null);
          request.onreadystatechange = function() {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        var response = request.responseText;
                        alert(response);
                    }
            }
          };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My servlet looks like this protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException { PrintWriter
I have this managed bean which makes SQL queries to Oracle database and returns
servlet-api.jar I shifted this jar file from one system to the other. But I
i wrote a little test programm which queries the status servlet of a tomcat
fact : servlet container creates one instance per servlet(hope i am correct on this
This [servlet or jsp] must return an XML document [for future processing by my
My Servlet app. gets called twice every time the user submits a form: The
A servlet class handles the incoming request object, fetch data & store into StringBuilder/StringBuffer
I have a web application where users enter arbitrary sql queries for later batch
Servlet Configuration in web.xml <servlet> <description>This is the description of my J2EE component</description> <display-name>This

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.