views:

308

answers:

7

I am a .NET / C++ programmer switching to Java. I had previous exposure to Java 10+ years ago in university.

What would be the typical things to be learned in order to be able to program web applications in Java?

I can think of: JSP/Servlets Eclipse EJB

What else do people use these days?

The idea would be to be able to land on a Java project and make myself useful

+10  A: 

Hibernate and Spring

willcodejavaforfood
Personally, I'd avoid Hibernate unless you *know* you need it for some reason. It's a monster dependency, full of magic, and difficult to control if perf is a concern. I've spent considerable time banging my head against it and removing it from code where it shouldn't have been used. Stick with vanilla JDBC; at least you'll know what your code is doing.
overthink
Then I am afraid you will need hibernate since that is what projects use nowadays. IF it is a good framework or not was not the question here.
willcodejavaforfood
Hibernate is used on a lot of Java web applications whether or not it is actually used the way it should be used. I agree with overthink's comment - Hibernate can cause a lot of issues, more than if you just used JDBC directly. However, I'd like to add that if you're using Spring, you *shouldn't* be using JDBC directly - Spring's JDBCTemplate (or advanced subclasses if using Java 5+) should be used instead, as it handles exceptions in a much more meaningful way.
MetroidFan2002
+5  A: 

Tools department: Eclipse and Netbeans

(For web-centric Java development, see the Eclipse based Aptana IDE)

gimel
...or, if you want something better (and are willing to pay for it), IntelliJ IDEA ;-)
Jonik
people complain all the time about Eclipse, but it's still a strong reference.If you want to hack some Google Android or Blackberry Apps, SDKs are available for the Eclipse platform.
Brian Clozel
+5  A: 

I migrate between a lot of clients who use Java heavily. Here's what I see people use:

a) a lot:

  • JDBC
  • Servlets
  • Ant
  • Log4J
  • Eclipse/Intellij

b) quite often:

  • JSP
  • Spring
  • Maven
  • Web Services
  • the Apache Commons libraries

c) barely ever:

  • EJBs (not since 2002 or so!).

I've not come across Hibernate or other ORMs. I'm not sure why, I confess, since it seems popular in the context of SO.

Brian Agnew
+1, seems quite realistic to me. (Although personally I haven't used JDBC directly for ages; database access is hidden behind Hibernate.)
Jonik
Maybe you should start recommending Hibernate to your clients. I can't even imagine writing a J2EE app without it these days.
Peter D
The above reflects what I find, not what I recommend.
Brian Agnew
+2  A: 

If you are focusing on web applications specifically, it's important to know and understand many topics that are independent of Java:

  • JavaScript
  • SQL
  • CSS
  • XML (XPath in particular)
  • HTML
  • HTTP

You need to get a grasp of these concepts before learning Java frameworks that may or may not simplify the creation of code dealing with them.

As far as Java-specific libraries and frameworks go, these are essential:

  • Servlets and JSPs
  • JDBC
  • Ant
  • Apache Commons -- for the love of all that's good, don't re-invent common libraries!

These are nice to have but are too narrow to focus on before learning everything above:

  • Spring
  • Hibernate
  • Maven
  • JSF
Steven Huwig
+1 for XPath. I've seen many a buggy 'indexOf' search in an XML string, where an xpath would have been much cleaner!
toolkit
+1  A: 

Presentation:

Presentation Frameworks:

Dependency Injection (and more):

Database:

And maybe:

toolkit
A: 

The Apache Foundation has done some great things:

  • Web service development made easy - Apache CXF
  • For java web applications, you can take JSP to the next level with Apache Tapestry
  • For project management (build process, quality control, migration...), Maven will do the work
  • ActiveMQ is a good choince if you need to implement a JMS service.

No need to rush and read tons of books about these, they pretty much use common concepts you probably encoutered in your previous experiences.

Brian Clozel
A: 

Grails is also a Java platform web application framework, although it's coded in the Groovy language rather than Java, which is more like Python or Ruby and is dynamically typed.

Andrew Noyes