Americas

  • United States

Automating Web form submission

Opinion
Oct 13, 20031 min
Enterprise Applications

* Dr. Internet columnist Steve Blass offers a reader advice on automating Web form submission

Our online workstation-inventory form records information about workstations when we make desktop service calls. We want to automate the form submission so technicians can update the inventory with a button-click. We want to use a Java applet, but it is difficult to read the system-level configuration information we want to record from the browser applet. Do we have to provide downloadable executables for each platform?

Try repackaging the applet as an application and deliver it to the workstation via a Web site link.

You can get the basic system properties object – call it p – with the System.getProperties() call and then use a call to p.list() to retrieve the properties list.

Collect the network configuration information through the InetAddress class by starting with InetAddress.getLocalHost() to get the primary IP address.

Any secondary addresses can be obtained by calling InetAddress.getAllByName on the result returned by InetAddress.getLocalHost().GetHostName().

After gathering the inventory information and formatting your message for posting to the Web server, establish a URL connection to the Web server form, open your output stream to the URL connection and post the inventory update message to the server.