Java Reference
In-Depth Information
{
if (key == null)
System.out.println(value);
else
System.out.println(key + ": " + value);
}
} while (value != null);
}
/**
* Typical Java main method, create an object, and then
* start the object passing arguments. If insufficient
* arguments are provided, then display startup
* instructions.
*
* @param args Program arguments.
*/
public static void main(String args[])
{
try
{
if (args.length != 1)
{
System.out.println("Usage: \njava ScanURL [URL to Scan]");
} else
{
ScanURL d = new ScanURL();
d.scan(args[0]);
}
} catch (Exception e)
{
e.printStackTrace();
}
}
}
This program is designed to accept one parameter, which is the URL that you would like
to scan. For example, to scan the web site http://www.httprecipes.com/ you would
use the following command.
ScanURL http://www.httprecipes.com/
Issuing the above command would cause the program to access the web site and then
display all HTTP server headers that were returned. The above command simply shows the
abstract format to call this recipe, with the appropriate parameters. For exact information on
how to run this recipe refer to Appendix B, C, or D, depending on the operating system you
are using.
Search WWH ::




Custom Search