views:

582

answers:

5

I was about to pick up some Java web programming since not having touched Java for a couple of years. I picked up an fairly old O'Reilly book that was sitting on my bookshelf (Java Server Pages 3rd Edition, covers JSP 2.0 & JSTL 1.1) and started skimming the pages. I went over to download the latest JSTL libraries and noticed that they are still at version 1.1. Wondering, is JSTL dead?

There are quite a few Java frameworks out there but to me they seem all bloated and XML configuration crazy. I like Java as a language and I like the fact that it runs in a server (like Tomcat) but I'd like to program Java web apps as if I'd e.g. would program PHP. To me, JSP and Servlets are good enough and such a handy thing like JSTL seems to make life easier. But apparently the rest of the world seems think differently.

Am I just not getting it and is JSP, Servlets and JSTL for dinosaurs? Should I stay away from this approach for good reason? Or can I safely stick with my Tomcat server, JSP's and Servlets to build my web apps and services?

+9  A: 

JSP, Servlets and JSTL are still very much the norm for java web development. Other frameworks like JSF and GWT are gaining traction, and are undergoing rapid development, but they remain in the minority.

JSTL has not been changed since version 1.x, it is true, but that's because it's pretty much good enough, and doesn't need a lot of improvement (it would use some, true, but nothing drastic).

The raw servlet API isn't one you want to use, though. Frameworks layered on top of the Servlet API (of which there are more than you can shake a stick at) and a much better bet. They mostly use JSP as their default view layer, though.

skaffman
+1  A: 

I still use JSPs (including JSTL) in applications.

The old applications have a somewhat demanding GUI which I would love to see implemented in Wicket or some such framework though.

Simple administration tasks however I'd implement in JSP (with spring-MVC or struts) because it's just dead easy that way.

I wouldn't implement a new, demanding GUI with JSPs anymore however unless the GUI logic is in the javascript. It's just too damned hard to deal with the various browsers, and demands for disabled people (no javascript) vs. javascript-heavy for people who can enjoy it. I like my framework to do that switch for me.

extraneon
+6  A: 

No, it is not dead. It is just so robust that nothing needs to be enhanced/fixed :) We still use it daily. What else would you use to control the presentation flow in JSP? Scriptlets? Oh thanks no.

However, there's already JSTL 1.2 which is basically just a merge of the two files it originally exist of (jstl.jar and standard.jar) along with very minor enhancements.

Regarding the frameworks you're talking about, those are mostly just MVC frameworks which are built on top of JSP/Servlet (and even JSTL).

but I'd like to program Java web apps as if I'd e.g. would program PHP.

I would say, that is a bad idea. Maybe not if it is just a simple single-page guestbook or contact form, but even then JSP would be too overflowing. Just stick with PHP if you want to write/clutter everything in a single page. JSP/Java really isn't there for.

To me, JSP and Servlets are good enough and such a handy thing like JSTL seems to make life easier. But apparently the rest of the world seems think differently.

You're not required to use one or other framework, but when the application grows out of its borders, you'd be happy if you've chosen an existing and robust MVC framework.

However, with the improved Servlet 3.0 API and the impressive JAX-RS API which came out along with Java EE 6 last week, I don't think you really need a framework.

BalusC
Thanks for your response. I feel that I can safely use JSP's and Servlets without being a total dork now. With the PHP thing I was more aiming at PHP MVC frameworks like Kohana and Codeigniter style, not the stereo-typical PHP programmer style. :)
Luke
A: 

If you want to write PHP applications in a jvm then look at Quercus from Caucho: http://quercus.caucho.com/

Thorbjørn Ravn Andersen
A: 

If you want to have somewhat extremely simple but at least as powerful framework as JSP+JSTL please consider using http://www.hybridserverpages.com. It does not require configuration as such (except for web.xml as it generates code on top of a Servlet).

Dima
Never heard of. Is it yours?
BalusC