The Source for Java Technology Collaboration
User: Password:



Editor's Daily Blog

Had I Known You Better Then

Posted by invalidname on October 14, 2008 at 07:51 AM | Comments (1)

A fresh look at the long-lived Servlet API

So, how many of us write raw servlets? There's a massive number of Java developers working at a higher level, isolated from the servlet by presentation frameworks like JSP, JSF, and business logic frameworks like Struts and Spring. But outside of those writing the frameworks, are there still people actually getting the output stream from the servlet request and writing bytes on it?

I bet there are. I wrote my first web apps straight to the servlet API because in 1997, there weren't higher-level frameworks yet, but years later, when I was directed to convert a Swing app to a webapp, the decision was made to use raw servlets rather than any higher-level framework because we were ridiculously tight for space on our remote servers and couldn't afford to load a couple hundred classes from some new framework.

Chances are, there are a lot more people than you might think who work directly with the servlet API, which is why it's good news that a thoroughly revised servlet API, Servlet 3.0, coming in the form of JSR 315.

Deepa Sobhana offers an introduction to the version of servlets in the latest Feature Article, An Introduction To Servlet 3.0 .

Unlike some previous releases of the specification, which were just maintenance releases, the Servlet 3.0 specification is packed with lots of exciting features required for the new era of web development. In this article, we will investigate key features introduced in the new version of Java Servlets. It is worthwhile to note that the specification is still in a draft stage and therefore the technical details discussed in this article are subject to change.

In this article, you'll see what Servlet 3.0 has to offer in terms of ease-of-use and extensibility improvements, security enhancements, the API's embrace of annotations, and the ability to use POJOs for your servlets and filters (and whether that feature will make it to the final spec).


In Java Today, Jersey, the production-quality reference implementation for JSR 311 (Java API for RESTful web services), has shipped its 1.0 release. Jersey's extensible API allows for a number of enhancements beyond the scope of the original JSR, as it includes adds Spring integration and a REST client. It also integrates with GlassFish v2 and v3, NetBeans 6.5, and Maven 2.

Jean Francois Poilpret blogs about the challenges of resizing Swing components and what to do with extra vertical space, in DesignGridLayout: real-time resizing of JScrollPane. "I found out that there are only 2 categories of components that want extra height when it becomes available: any Component that is set as the view of a JScrollPane (in particular JTextArea, JTable, JList), and any JSlider using JSlider.VERTICAL policy. Besides these, I did not find any component that should grow height when its embedding dialog is resized. Based on these observations, I have implemented a simple internal mechanism into DesignGridLayout for distinguishing these 2 kinds of components."

A new Enterprise Tech Tip over at the SDN takes a look at Securing Attachments With Metro 1.3. "The WS-SecurityPolicy v1.2 specification from OASIS now includes an assertion for integrity and confidentiality protection of SwA (SOAP Messages with Attachments) attachments. This assertion is also a supported feature in Metro 1.3. In this tip, you will learn how to secure an SwA attachment using Metro 1.3 and NetBeans IDE 6.5 (currently available as a Beta release). The new features in the Metro 1.3 release are available in NetBeans IDE 6.5 through a web services plugin."


Today's featured posts from the Forums include a number of contentious threads, starting with terrencebarr's reply to the bang-enhanced Re: Would Sun support real developer platforms like Linux and Mac!! "Understand your frustration with the platform support situation - I'm also a Mac user and would love to have first-rate Mac support for mobile development. Please keep in mind that the Java ME SDK is an EA, designed to get it out into the hands of developers as fast as possible - that's a key reason it is limited to one platform right now. This ME SDK has a lot of goodies that fundamentally improve portability such as using the NetBeans platform as the application framework as well as using phoneME as the emulation platform - both are much more portable than the corresponding components in previous WTK versions. This is an indication where Sun is going."

i30817 offers gripes and workarounds in the followup Re: Will JFileChooser be fixed for Java7? "The gnome reader is outdated with the current one. I hope that they replace the current api with a wrapper of the native filechooser. It is really the only component that NEEDS to be implemented and is composite, so it makes sense to wrap it. On linux/gnome what is currently driving me crazy is folder selection. Did you know that selecting folders you need to be INSIDE the folder? Basically select the folder, click ok, and click ok AGAIN."

Finally, kirillcool questions the value of the "file a bug" mantra in Re: Java WebStart (JNLP), JavaFX on 64-bit machines. "And my point was on the usual "vote for the bugs because this is very important" mantra being repeated over and over again. If the words are not backed up by actions (by either fixing the bugs or marking them as closed with the above resolution), then the words are meaningless. And the more they are repeated, the less weight they are carrying."


Finally, in today's Weblogs, Sebastien Dionne introduces himself as a New committer for Grizzly framework. "I'm happy to be a new committer for Grizzly framework. I started using Grizzly since few months, and I mostly did demos using Grizzly. I did a Migration Guide for network applications using NIO. The article has been choose in the(GlassFish Awards Program)."

Neto Marin blogs about his mobile conference scheduler in New issues to CoSMo project and CoSM on Mobility podcast! "With all the source code available on SVN, it's time to create some issues. And also, I talked about CoSMo with Roger @ JustJava 2008."


Current and upcoming Java Events :

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.




Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • > are there still people actually getting the output stream from the servlet request and writing bytes on it?

    Of course there are. Sometimes the gazillion and massive frameworks in Java just aren't as appealing from a KISS perspective. I'm finding myself writing raw servlets again for REST/JSON purposes, it's clean and simple. Some of the stuff even makes it into micro-frameworks: http://code.google.com/p/httprmi/

    So while I am all for reuse, sometimes it's just simpler to deal with a protocol yourself which involves very few layers, no external dependencies but actually allows you to fully understand what's going on and focus on the job at hand.

    Posted by: mrmorris on October 14, 2008 at 04:42 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds