views:

461

answers:

6

I've been developing in java then I stopped, so now since I have my google app engine account I wanted to start with this again. Also I love web and I know struts is a good MVC framework. I've been reading this. do you think struts can help me to start or should I start with "plain" servlets, and then go to some framework

+2  A: 

I'd definitely start with an MVC framework as opposed to "plain" servlets as you suggest.

While I've used Struts 1.x a lot, I think for a new application you should look at Struts 2, Spring MVC or some other newer framework that leverage new Java features such as annotations.

pgb
+9  A: 

I would at least learn the basic servlet lifecycle and API.

As Joel puts it abstractions are leaky and this applies to frameworks--all frameworks not just Web ones--equally well. You will be much better equipped to use a framework, to know why it's good and how it can help you if you understand the underlying technology, the thing it is trying to abstract.

As for Struts, I would steer clear of STruts 1. It's rather ancient now. There's still a lot of code around for it but I wouldn't consider it best practice now, particularly for its (over)use of inheritance. Struts 2 is really a completely different framework based on Webwork.

There are plenty of other MVC frameworks out there. Personally I like Spring MVC as being quite "pure" and lightweight.

cletus
+1  A: 

I completely agree with cletus in the sense that I would start by completely understanding Servlet/JSP first.

After that, I would go to a more modern framework than Struts. To me, JSF or Spring sound like better options than Struts these days.

Pablo Santa Cruz
A: 

I too agree in that learning fundamentals (Servlet API is a must, jsp/jstl highly recommended) first is the best thing to do. And for many simple things jsp/jstl combo is actually plenty good. But bigger the system, less maintainable such web apps tend to become. This is inverse of using heavy frameworks like JSF.

Beyond ones already suggested, I would recommend checking out Tapestry and Wicket: many developers like them. My experiences with JSF have been bit negative; but it's one of those love-or-hate frameworks, many swear by it, others just swear at it.

StaxMan
+1  A: 

Struts 1 is now obsolete and Struts 2 doesn't seem to be getting much traction. There are lots of good frameworks out there, and you may want to consider instead: JSF, GWT, or Spring for example.

Stephane Grenier
A: 

I suggest you to use Struts 1.x rather than Servlet, because this gives you lot of benefits like

  1. PageNavigatin
  2. Input validation
  3. Extensibility
  4. Modularity
Thomman