0

I developed a web page that run my applet.

My question is:

What is a servlet?

How do I use it in server side code? (VB-SCRIPT, ASP.NET or PHP)

I wrote an applet and I successfully use it in client side code.

So I need to run my function in server side.

R.E
  • 107
  • 1
  • 12

2 Answers2

2

Learn about servlet at http://en.wikipedia.org/wiki/Java_Servlet, http://www.tutorialspoint.com/servlets/, it is Java server side programming

Hamed Ali Khan
  • 1,108
  • 3
  • 23
  • 29
1

The servlet is a Java programming language class used to extend the capabilities of a server.
Although servlets can respond to any types of requests, they are commonly used to extend the applications hosted by web servers,
so they can be thought of as Java applets that run on servers instead of in web browsers. These kinds of servlets are the Java counterpart to other dynamic Web content technologies such as PHP and ASP.NET.

you can call servlet from PHP.
following is code for that.

    $(document).ready(function() {
    $("#idd").click(function() {
     var txt1 = $("#store").val();
     $.ajax({
                url : 'http://localhost:8080/xyz/AbcServlet',
                data : 'val='+txt1,
                type : 'GET',
                success : function(response) {
                    alert("Success");
                    // create an empty div in your page with some id
                },
                error: function(){ alert("error");

                }
            });
    });
              });
Mitul Maheshwari
  • 2,647
  • 4
  • 24
  • 38