1

Feedback on a question I asked earlier has me wondering if there exists such a document or book as the one alluded to in this question title. I have searched the web in general, and previous StackOverflow questions (maybe I missed the right one?), but I have not been able to find what I am looking for.

I have several years experience with web development using PHP. My PHP work is mostly procedural, but I do use objects when appropriate. I like the PHP environment; that is, I like not having to compile and deploy for code changes to take effect. I like being able to use the same language for business logic and presentation logic. I like the ease of finding decent documentation for PHP. And I like how simple it is to setup an execution environment for PHP scripts (e.g. mod_php).

However, I am in the position of administering, and doing almost all of the in-house development for, a Java web application (a portal) being served with Apache Tomcat. Coming from the background described, I have been applying my "PHP way" of thinking to the Java work I have to do. Which basically means I forget about figuring out how to setup a development environment and just stick JSP scripts in the web root and avoiding writing full classes.

So, to list the things I am looking for in such a book:

  • Differences in terminology (e.g. why a web server is called a "container")
  • Differences in operating environment
  • Comparison of language best practices

I am not looking for "Java is object oriented and PHP isn't." I understand that the languages are different. I also don't want the silliness that is Head First Servlets & JSP (a book my office has lying around).

Community
  • 1
  • 1
James Sumners
  • 14,485
  • 10
  • 59
  • 77
  • 5
    If you're unfamiliar with Java, and are trying to start with J2EE related stuff from the get-go, the *Head-First* book might not be too bad a choice. Why do you think it's silly? Have you read any of such books before? Granted, they're rather elementary, but given the fact you have very little experience with Java, you might give it a try. – Bart Kiers Dec 07 '10 at 22:15
  • 1
    Here are several useful links: [PHP vs JSP](http://stackoverflow.com/questions/1283413/php-vs-jsp-which-should-i-learn), [Servletcontainer vs Webserver](http://stackoverflow.com/questions/1900885/difference-between-web-server-and-servlet-container), [Java webdevelopment skills](http://stackoverflow.com/questions/1958808/java-web-development-what-skills-do-i-need). – BalusC Dec 07 '10 at 22:20
  • Bart: I think it is silly for a couple reasons. 1) It tries to turn a technical topic into some sort of bed time story. 2) There's more clip art, cartoons, and other such nonsense than there is content. It's no K&R book, that's for sure. – James Sumners Dec 08 '10 at 13:32
  • fair enough, but many people *do* like them, so I wouldn't call it "silly" (unless you don't mind coming across like an elitist :)). – Bart Kiers Dec 09 '10 at 06:58
  • +1 for very well formed question :) – Adrian Schmidt Dec 14 '10 at 12:28

2 Answers2

1

I would highly recommend you to start with java helped on a framework like Spring. This will allow you to put away almost all the initial web java developer headaches and give and much better learning progression. Once you get managed with Spring Framework (of course use version 3.X) you should only worry about learning a bit of JSTL to give all the functionality you had on the presentation layer. If you mix all this with a good javascript framework like jQuery you'll get on the road much sooner than you think. 1) Learn a bit of JSP directives. 2) Take a look at JSTL. 3) Learn Spring 3 (MVC) 4) Learn JSTL in a deeper way.

user496208
  • 69
  • 1
  • 2
0

To be honest, and i don't have a whole lot of experience developing on Java application servers, but i think you would do better just using a pure Java book (college/uni level), learning object oriented principles(inheritance, polymorphism, encapsulation) and java's OO constructs if that is not your strong suit. During the process you'll be able to compare and contrast the features to php you've already seen. The reason i say this is because the java API's are constructed using these things very heavily (abstract classes, packages, inheritance etc.) and you'll have to work with them, not against them to get anything done in terms of plumbing. In my experience, comparative books don't work, because it comes from the mindset that the two languages just have differing terminology, but are fundamentally the same in some way. This is misleading, because java ee has a lot more underlying building blocks that you have to be aware of before you jump in and start writing code for HTTP requests.

I would look at the official documentation for your preferred server, and for the java ee background reading I would stick to oracle's documentation, as it avoids misinterpretation of definitions.

just out of curiosity, is there a particular reason you have not moved toward a more object oriented approach of PHP before moving to the monstrosity of java ee?

Steve Rathbone
  • 458
  • 1
  • 5
  • 14
  • You seem to have misinterpreted my question. I am not looking for a PHP language vs Java language book. I am looking for a book that teaches someone who knows PHP _web development_ how to standard do web development in the Java environment. – James Sumners Dec 14 '10 at 13:38
  • ahh i see - sorry about that, i think the only thing i could offer then are some links: – Steve Rathbone Dec 14 '10 at 20:04
  • http://docs.sun.com/app/docs/coll/1343.13 ( in particular the application development and deployment guides), as well as http://download.oracle.com/javaee/6/tutorial/doc/bnadr.html and the tutorials on roseindia – Steve Rathbone Dec 14 '10 at 20:14