Reputation: 11
Is there a way to use a Servlet from my aspx page? My application is running on the IIS server. I want on a button click to be able to run the Java code present in Servlet's method.
Upvotes: 1
Views: 535
Reputation: 1109874
Yes, there are ways.
Deploy the servlet to a servletcontainer the usual way, e.g. on the same server. This way the ASP.NET program can invoke a HTTP web request on the URL of the servlet and obtain its HTTP response body as a stream or a string.
Refactor servlet's code into a standalone Java class which you can invoke via an applet embedded on the page, or via the command runtime like java com.example.SomeClass
.
Port the Java code to C#/.NET code, so that it can just be run in the same context as your ASP.NET program.
Upvotes: 2