Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Skip RMI of Head First Java?  RSS feed

 
Henrique Aguiar
Greenhorn
Posts: 12
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I've been reading Head First Java, and I've come to the last chapter, where it talks about RMI. But I have had some trouble, and I found this thread which roughly describes my problem: http://www.coderanch.com/t/659402/java/java/Remote-Deployment-RMI?nonMobile=true

So, apparently, the RMI part is really outdated. My question is, should I skip this part then? Is it important for me to learn?

Thanks.
 
Campbell Ritchie
Marshal
Posts: 55681
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henrique Aguiar wrote:. . . My question is, should I skip this part then?
Yes.
Is it important for me to learn? . . .
No.

Many people no longer use RMI so you can ignore that section.
 
Henrique Aguiar
Greenhorn
Posts: 12
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Henrique Aguiar wrote:. . . My question is, should I skip this part then?
Yes.
Is it important for me to learn? . . .
No.

Many people no longer use RMI so you can ignore that section.


Right. What about the absolute last topic, which is about servlets? Apparently I'd need a web server running to follow through the tutorials. Should I skip them? Or set up a web server? If the latter, how do I do that?
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's your environment? What, if any, IDE are you using? You would probably want to use Apache Tomcat as your servlet container and web server, but this is not beginner stuff! You might want to post another thread in the Servlets forum.
 
Henrique Aguiar
Greenhorn
Posts: 12
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:What's your environment? What, if any, IDE are you using? You would probably want to use Apache Tomcat as your servlet container and web server, but this is not beginner stuff! You might want to post another thread in the Servlets forum.


I use Eclipse. Could you point me to tutorials on how to use this Tomcat thingy?
Thanks
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the easiest way is to write or copy some code that uses a server, then in Eclipse, select Run -> Run As... -> Run on Server. If there are no servers, it will start a wizard that will take you through installation. Pick Tomcat 8.0, or the latest version.

Tomcat thingy

I think the best way to think about Tomcat at this point is, it is something that will turn your Java code into a website. So you don't have a main(), you have methods that react to HTTP requests. You don't run it by a java command, you launch it in a server (which has to be running).

Once you launch the Java code in a server, you will use your browser to view and react to the program. Usually the URL is something like localhost:8080/projectName.

I'm just scratching the surface here. This is something you should research a bit and play with a lot.
 
Henrique Aguiar
Greenhorn
Posts: 12
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:I think the easiest way is to write or copy some code that uses a server, then in Eclipse, select Run -> Run As... -> Run on Server. If there are no servers, it will start a wizard that will take you through installation. Pick Tomcat 8.0, or the latest version.

Tomcat thingy

I think the best way to think about Tomcat at this point is, it is something that will turn your Java code into a website. So you don't have a main(), you have methods that react to HTTP requests. You don't run it by a java command, you launch it in a server (which has to be running).

Once you launch the Java code in a server, you will use your browser to view and react to the program. Usually the URL is something like localhost:8080/projectName.

I'm just scratching the surface here. This is something you should research a bit and play with a lot.

Thanks! But I'm still a bit confused regarding to the mechanics of web servers, Tomcat and servlets. Do you know any good tutorials that explain them (and how to use them) thoroughly?
 
Dave Tolls
Rancher
Posts: 2911
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't Head First explain how to set up a server?
I would have expected it to if it intended you to learn about servlets etc.
Unless it's just an overview.
 
Henrique Aguiar
Greenhorn
Posts: 12
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does explain how to write servers, only not web servers.
 
Tapas Chand
Ranch Hand
Posts: 614
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henrique Aguiar wrote:It does explain how to write servers, only not web servers.

Though I have not gone through Head first, I think in this context, servers and web servers are one and the same.
And we as web application developers do not "write" servers, we "use" servers (Apache tomcat) to run our code.
 
Henrique Aguiar
Greenhorn
Posts: 12
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the servers I have learned are basically just programs that keep waiting for clients to connect and send requests (through data streams). Is that what web servers are like?
 
Dave Tolls
Rancher
Posts: 2911
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah.
It's a chapter on sockets and the like.
In which case, don't worry about Tomcat.

It's worth doing the chapter, though, IMO.
 
Henrique Aguiar
Greenhorn
Posts: 12
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um, no. The chapter is actually about RMI and servlets and stuff. But for some reason, the book basically assumes you already have a web server up and running without really explaining how to do that.
 
Campbell Ritchie
Marshal
Posts: 55681
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forget about the servlets too, then. Look on them as an advanced feature; I think they are a JavaEE feature. If you look in our Servlets forum, you may find some FAQs.
I tried a search and found 1 2 3 4 links. I think No 4 will be the most useful and is probably the FAQs I mentioned earlier, but I haven't looked at any of the links.
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! But I'm still a bit confused regarding to the mechanics of web servers, Tomcat and servlets. Do you know any good tutorials that explain them (and how to use them) thoroughly?

Apache HTTD Server is the most popular web server. It runs in the background listening for requests on port 80. The request comes from your web browser. It says something like "Please send me web page abc.html." The web server looks at its document area, reads the file, and sends the HTML to the browser. It is the browser's responsibility to render the HTML in some way.

There is no reason to write a web server except as a learning exercise. Here is a very simple web server in Java that does nothing but print a headline in the browser. You would this at the command line, then go to your browser and type in an address like "localhost" or "127.0.0.1". You should see one line in your browser.
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache Tomcat is one way of creating dynamic web pages with Java. It implements several Java technologies that help create a webpage from Java code such as servlets and JSP. Here is a tutorial for writing servlets.
 
Dave Tolls
Rancher
Posts: 2911
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's also a book in its own right...several usually.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!