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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:37:45+00:00 2026-06-16T20:37:45+00:00

I have a web application that currently hosts an applet in a web page.

  • 0

I have a web application that currently hosts an applet in a web page. The applet connects to a Tomcat Servlet and sends requests. It would be more convenient for some environments if my solution could use Javascript instead of Java applets on the client. But this would require Javascript to send a POST to the Tomcat Servlet.

The web pages are served by the same web server – and actually the same Tomcat instance. But the applet sends requests to a DIFFERENT Servlet.

The Javascript basically would need to query the Servlet periodically and based on responses call a javascript function.

Would that be possible?

If so, any pointers on how to get started?

  • 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-16T20:37:47+00:00Added an answer on June 16, 2026 at 8:37 pm

    Yes, JavaScript can send POST requests to arbitrary web servers. If you have control of the servlet you can avoid all cross-site scripting restrictions by setting access-control-allow-origin properties.

    AJAX is a term in the web community that refers to JavaScript + HTTP requests. I recommend this AJAX tutorial from MDN. I also recommend jQuery’s AJAX library.


    Some versions of Internet Explorer will give you trouble even if the server is set up correctly. Here’s a JS function I use to cover all the browsers:

    /**
     * Wraps jQuery's AJAX, adds X-Domain support for IE
     */
    function xDomainAJAX (url, settings) {
      if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && XDomainRequest) {
        // use ms xdr
        var xdr = new XDomainRequest();
        xdr.open(settings.type, url + '?' + $.param(settings.data));
        xdr.onprogress = function() {};
        xdr.onload = function() {
          settings.success(xdr.responseText);
        };
        xdr.onerror = settings.error;
        xdr.send();
      } else {
        // use jQuery ajax
        $.ajax(url, settings);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that can load plugins through reflection. It currently uses
We have a web application that uses dropbox as file storage. We have currently
I'm currently writing a web application that have about 6-12 pages. On each one
I currently have a Web Application that runs off a global Javascript-based API, and
We have a console application (currently .NET) that sends out mail in bulk to
I have an web application that displays employee birthdays for the current month in
I have a web application that allows users to enter search criteria and the
I have a web application that will be used on iPhones, and want to
We have a web application that is generating some 3-5 parallel threads every five
I have a web application that maintains a version flag as a ServletContext.setAttribute('flag', flagValue)

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.