Calling Java class from JavaScript without servers

I have a java class and I want to access the same class in HTML page using JavaScript. I want to know what are the possible ways of achieving this.

1 answer

  • answered 2018-05-16 05:50 Hello World

    Convert your Java Class into Servlet and using Ajax hit the servlet and do the required tasks. look into this for a starter.

    You can either use a servet engine like tomcat, and write a servlet that will serve your JSON document, or use the* classes that is in the JRE.