Use java.net.URL object to connect to the servlet from your java program. For example you want to call a servlet at javaranch site, use like this
Get the java.net.HttpURLConnection from this object and manipulate it. This works fine for the get methods only. For post methods, check methods in HttpURLConnecion object before opening the connection to the server.
Actually this is a normal problem and the solutions have been posted in this forum lot of times.
Originally posted by deshmukh amol:
I have to send data like (username,address,company name) from java method to a servlet.The servlet actually is invoked by an HTML page.so this servlet uses getParameter(" ..").Now my problem is sending data to this servlet and populating those parameters and invoking it.(i cannot change the servlet code).somebody help me.