I have recently created a java application(calculator) 开发者_如何学Cin netbeans and need to make it into a web service. How do i convert it?
You should take a look at the Java API for RESTful Webservices (JAX-RS). You can easily convert a basic POJO into a webservice using annotations (http://download.oracle.com/javaee/6/tutorial/doc/gilik.html#gilru).
Of course, if your calculator application is just a standalone Java application (ie. main method running through command such as 'java calculator') you will have to setup a web application and run it in a web container. Check out http://download.oracle.com/javaee/1.4/tutorial/doc/WebApp.html for details on getting started with Java web applications. Check out GlassFish (http://glassfish.java.net/), Tomcat (http://tomcat.apache.org/) or Jetty (http://www.mortbay.org/) for some web container options.
精彩评论