Posts Tagged jax-rs
I’ve been the lead developer for MyEclipse web service developer tools for almost two years now. Until recently we had concentrated all of our energy on the heavyweight SOAP web service technology stack. Yet, the lightweight REST web service movement was something we had been researching and planning to support. The question was when would we add that support for MyEclipse….
At my EclipseWorld presentation, I gave a talk on web services. To elicit the audience’s interest in REST, I demonstrated ad hoc REST development using MyEclipse 6.5. Now MyEclipse 6.5 web service tools did not explicitly support REST, so I improvised for my demo. With a few hours of trial and error web project setup and configuration I was able to create a helloworld REST web service project that I could deploy and test. I mention this ME 6.5 experiment with REST web services and the troublesome and time consuming process as a contrast to the convenience of the new MyEclipse 7.0 REST web service features.
MyEclipse 7.0 introduced REST developer tools that make REST web service development drop-dead simple with no configuration complexity, Maven or otherwise; create a REST web services project in a few clicks. Jersey 1.0 libraries and dependent JARs are split among a few MyEclipse containers to help you choose exactly what you need for your application. If you want to manage your dependencies with Maven, that’s possible too, all you have to do is check a box, MyEclipse will deal with your pom.xml dependencies for you.
To create a web service, select a class (or create a new one), specify the path, add a few methods and you’re done.
The method wizard can be invoked from the above class wizard to add new methods or directly from the Java editor to add methods to a class you are currently editing.
If you’re a MyEclipse PRO subscriber, you can use the REST Web Services Explorer to test your web service from within the IDE.
For all their coolness though, the wizards in MyEclipse 7.0 had no editing support. You could use them to add a new class or add methods, but you could not use them to edit existing classes or methods. This left you hanging when it came to modifying existing service annotations. REST with JAX-RS is annotation heavy, and a complex method could have at least 10 annotations and you certainly wouldn’t want to be editing those by hand if you could avoid it.
In MyEclipse 7.1, I worked in the editing support for both the method and the class wizards. You can bring up the editor from the context menu in the Java editor, Outline view, Package explorer, etc. Just select (or place your cursor in) the method or class you want to edit and bring up the context menu to invoke the wizard.
The wizard will open pre-populated with all the REST annotations filled into it’s fields. You can now add, edit or delete annotations. You can even add and remove parameters from methods. When you hit finish, only the changes you made are written back to the editor, you don’t have to worry about losing any other (non REST) changes you may have made manually.
One of my favorite things about these wizards is the ability to invoke them while typing using Ctrl + 3. So if you’re in the middle of editing your code and you want to bring up the wizard, press Ctrl + 3, type in “edit rest” and choose the wizard you want. Much faster than moving your hand over to the mouse and selecting from the context menu, I say.
In 7.1, we also moved on to Jersey 1.0.2, which brings in a new MIME and Multipart API and a large number of fixes and enhancements. The REST Web Services Explorer will now display JSON output in the Raw View, you no longer need to save it as a file and then open externally.
The intuitiveness of the REST tools are all about making REST development a no-brainer hassle-free experience. The Eclipse World demo I discussed at the beginning of this post took me under five minutes to finish with our REST tools. Now you’re probably thinking, “But isn’t REST supposed to be easy? Why do I need tools for a process that is easy?”. True, but only once you know all the principles behind the process and have gone through the initial error prone setup; hopefully not having quit due to sheer frustration! Even after you know what is involved, execution is still a manual process for most part and will still take time, no matter how much you know. Why spend hours pottering with your dev environment, research and syntax when you can just use MyEclipse? Spend the time working on a bad-ass service for your customers instead and let us do the heavy lifting for you.
We have plenty of ideas for future REST features; Spring integration, JPA integration, WADL support for top down service / client generation, … how about you tell us? We’re listening.
Do read our MyEclipse REST / JAX-RS tutorial for more details.
If you’re wondering why I jumped straight to a MyEclipse 7 post without any “non-work” posts in between, then you’re staring the reason in the face… MyEclipse 7.0. Since MyEclipse 6.6, we’ve presented at Eclipse World (more about that later) and worked on nothing but MyEclipse 7.0. Besides new features, this release includes much awaited updates and fixes across the board. MyEclipse 7.0 and MyEclipse 7.0 Blue Edition were released on the 9th, so without wasting more time, let’s dive right into the juicy details…
7.0 is our first production release for Ganymede (Eclipse 3.4), preceded by two milestone releases in the 7 series. It is also the first MyEclipse release delivered on top of the Pulse Eclipse Management Platform and includes a Pulse based plugin dashboard. As an end user, this enables you to:
- Install optional and early access MyEclipse plugins.
- Update MyEclipse easily.
- Easily add and manage 3rd party plugins to your MyEclipse installation.
- Move to another machine but continue to use an identically configured MyEclipse installation (including 3rd party plugins) with ease.
- Share workspaces and workspace settings with co-workers.
The ability to share workspaces is only available to Pulse Freelance subscribers, all other features are absolutely free.
MyEclipse 7.0 adds JAX-RS to it’s list of supported web service frameworks. This means you can now develop, deploy and test RESTful web services in MyEclipse. We use Jersey, the JAX-RS reference implementation. I’ll try to provide more details in a later post.
An early access version of our UML2 features can be installed via the dashboard. This includes a massively detailed UML2 graphical editor. So if you feel like cranking out a Composite Structure diagram (I don’t 😉 ), you know where to look.
- Spring Tools built on SpringIDE 2.2.0, with Spring Web Flow 2 support
- MyEclipse Reports now built on BIRT 2.3.1
- OpenJPA 1.2 support
- JSF EL content assist enhancements and support for Apache Trinidad tags
- ICEfaces 1.7.2 SP1