Home > Articles
When programming an EJB, you’ll write a bean interface (local or remote interface), a home interface (also local or remote), and a bean class. In the case of an entity bean, you’ll also need a primary key class if you don’t use a standard Java class for it.
If you ever tried using RMI through a firewall you must have noticed a ‘strange’ behaviour concering the usage of ports.
Opening the rmi port (in most cases this is 1099) in the firewall, doesn’t solve the problem.
As you may already know, your RMI Server opens up a serversocket on port 1099 and then listens here for incoming requests.
In this tutorial we are going to write a simple java program, which connects to a Web server and downloads webpages and documents that one is interested in. With the help of an example program you will see the use of Java’s URL and URLConnection classes in the java.net package to download data and content from Internet servers.