By ranjansatya on Jun 04, 2010
After 6 years in Sun, now I am leaving Sun to pursue another career opportunity outside Sun. So I am saying good bye to my sun blog and you can now find me blogging at
Recently the JSR 286 draft was available for public review which can be downloaded from this link. It includes some of the major features which were missed in the JSR 168 spec. You can visit Deepak's blog to get a list of all those major changes. One of the major feature introduced in this new Portlet specification is "Resource Serving" . In this blog I will explain this feature in detail.
In one line "The resource serving feature provides the ability for a portlet to serve a resource".[Read More]
The Portal Pack 2.0 preview is now available for download here. Though in this version there are no functional changes in the serverplugin modules, but there are some changes in the portlet builder (Generic Portlets) module. Unlike earlier version, in this version of the Portal Pack, there is no separate "Portlet Application" project type. In this version Portlet application is supported through web framework. So "Portlet Support" can be added to a new/existing web application through web framework. In other word you can say an existing/new web application can be extended to support Portlets inside it. To know how to create portlet application in this version click here.
In my last blog, I had mentioned about the IPC Story Board which is an upcoming feature in the next version of the Portal Pack. In brief IPC Story Board in Portal Pack will help developers to implement Inter Portlet Communication/Eventing in their portlets in a visual manner. More importantly it also generates most of the eventing related code automatically for you. In my last demo I had also linked to a screen cast which gives an idea how this IPC Story Board will work in future. But now there is a new flash demo available which shows a full functional IPC Story Board in action. This feature will be supported in the next version of the Portal Pack for NetBeans 5.5/5.5.1. The new binaries are not yet available on the Portal Pack project site, but those will be available very soon. In this flash demo I have created a simple shopping cart portlet application using Portal Pack + NetBeans 5.5 with IPC Story Board support. The application developed using IPC Story Board can be deployed/run on Open Portal Portlet Container / Sun Java System Portal Server 7.x . The future version of the IPC Story Board will also be supporting JSR-286 portlet eventing.
If you are interested to see the fully functional IPC Story Board in action then check this screencast.
Let me know if you have any suggestions & feedbacks or you want to see any new features in the Portal Pack.
Now a days I am working on some new features for Portal Pack. One of the features I am working on is "IPC Story Board" for Eventing. Portal Pack IPC Story board will be useful for all portlet developers who want to make their portlets consume events thrown by other portlets. Though eventing is not part of the current portlet specification, but it will be part of the next portlet specification. IPC Story board will be providing drag and drop support where the developers will be able to drag and drop their portlets and then visually wire them with each other. If you want to see an early preview of IPC Story board in the Portal Pack then check this small flash demo.
The Portal Pack 1.1 Plug-ins (NetBeans Portlet Plug-in) are now available in the Java EE 5 Tools Bundle Update 3 Preview. The Java EE 5 Tools Bundle is a complete,developer-friendly environment with all necessary runtimes installed
and fully configured to start portlet application development.
The Java EE 5 Tools Bundle includes following fully configured and ready to use components for Portlet Application development:
Note: Incase you are already using Portal Pack Plug-ins in your NetBeans IDE, you can update to the latest version of Portal Pack plug-ins.The latest version of the Portal Pack plug-ins are available for download here.
Some highlights of this release are
Here are the links to the resources and docs for Portal Pack 1.1 Plug-ins (Netbeans Portlet Plugin)
Portal Pack Portlet Plugins are now also available at NetBeans Auto Update Center Beta. To install/update latest version of these plugins
> Go to Tools > Update Center menu of NetBeans 5.5 IDE
> Select "NetBeans Auto Update Center Beta" check box in the list of update centers
> Click Next
The following modules of Portal Pack are required for Portlet Development support in NetBeans IDE
The same modules are also available as a zip archive at http://portalpack.netbeans.org/download.html
The NetBeans Portlet Plugin is now available for download which includes a plugin for the Portlet Container 1.0 Beta component bundled with the Java Application Platform SDK Update 2 release. Read about Java Application Platform SDK Update2 release here. To download the Java Application Platform SDK Update 2 click here.
Portlet Container 1.0 Beta, an Enterprise Class Portlet Container implementation is derived from the open source project on https://portlet-container.dev.java.net.
As a plugin for NetBeans IDE 5.5 and above, current release of NetBeans Portlet Plugin helps developers to develop, deploy and test portlets on the Portlet Container 1.0 Beta component that is part of the Java Application Platform SDK U2 from their NetBeans IDE. NetBeans Portlet Plugin makes portlet development as easy as writing a normal Java application, with all the features of portlets made available to you at the click of a mouse.
Some highlights of this plugin are
Here are the links to the resources and docs for Netbeans Portlet Plugin
Visit the NetBeans Portlet Plugin home page for future releases and announcements.
A new open source project called "portalpack" has been created on netbeans.org. As a plugin to Netbeans IDE 5.5 and above, this module will provide full portlet developement life cycle inside Netbeans IDE. Now portlet developer can develope, deploy and test their portlet application inside Netbeans IDE. Initially it will support Sun Java System Portal Server 7.x and Sun Open Source Portlet Container. Check out online flash demo at http://portalpack.netbeans.org to findout various features of new portalpack plugin. Downloadable binaries and sources for this plugin will be added very soon to netbeans.org.
Recently I was trying to use "jMaki" for some demo application. I found it quite simple and useful. For those who are not aware of "jMaki", here's a brief description about the project "jMaki"
"jMaki is an opensource project in java.net. It is a framework that provides a standard way for designing or creating reusable AJAX-enabled widgets and the services needed to back those widgets. The framework includes a simple widget API that you can use to create new widgets or wrap existing widgets from widget libraries such as those from Dojo, Yahoo UI Widgets, Google, Abobe Spry, or Scriptaculous."
The current version of jMaki has some widgets which are wrapper of ajax libraries like Google Map, Yahoo Geocoder, Dojo clock and Dojo editor etc. You can use those widgets in your web application easily using jmaki api. There is a Netbeans plugin for jmaki available on java.net. This plugin can be used for automatic code generation by doing just drag and drop of widgets.
If you want to try jmaki quickly then try this plugin.
Before adding any widgets to your jsp page, you have to add a taglib declaration at the top of your jsp. Here's the code for the taglib declaration
<%@ taglib prefix="a" uri="http://java.sun.com/jmaki" %>
Here's the sample code to show a yahoo calendar in your jsp. Just add this below line in your jsp and you will be able to see a yahoo calendar in your jsp page.
For flickr Search add
Event handling is the best thing I like most in jmaki. jmaki provides api for handling events between multiple different widgets. It follows the subscriber/publisher model to handle events. And the best part is it's totally a client side api and the eventing works totally in client side through java script. So it's fast and doesn't have any serverside dependency. So if you have multiple widgets in a page and if you want to make those widgets to interact with each other without any code dependency, then you can make a widget to publish an event so that all subscribed widgets can listen that event and acts appropriately. Let me explain how it actually works.
where topicA is the topic name.
Now all other interested widgets can subscribe to this topicA to listen the event. This can be done by the following code
So if you have three widgets in a jsp page let's say widgetA, widgetB, widgetC. And widgetB and widgetC work depending on the state of the widgetA. Then widgetA can publishes a event whenever it's state changed and widgetB,widgetC can listen that events and works appropriately.
I also tried to use these jmaki widgets in portlet environment inside portlets. It worked after a few customization steps. Also the eventing things worked between multiple portlets where each portlet contains a different widget.
I will post the steps to use jmaki in portlet enviroment in a separate blog soon.
Here's the link for jmaki home page
Recently I had a requirement where I needed to bundle my application in to a single jar file. Here single jar file means to bundle everything (including util jars) into a single jar file, so that any one can run that jar file by “java –jar “ option or using other options. Bundling application into single jar file also makes the distribution process easier. Initially I was thinking it’s not a big deal and just setting the classpath in jar’s manifest file would be fine.
Here’s required structure of the jar file
Then I added a classpath entry in manifest for all utility jars. But that didn’t work. After some googling I came to know that classpath mentioned in the manifest is checked and loaded from file system not from the content of the jar. So the class loader checks for util1.jar and util2.jar inside util directory in the filesystem not inside the jar. So we can’t solve this problem by mentioning the class path in manifest.
As I didn’t have any solution for it, after some google search I found an open source tool “one-jar” which actually describes how to load utility jars inside main jar file. In brief One-JAR uses a custom classloader called JarClassLoader to load information from the single jar file and it has it’s classes to control bootstrap process. If you are interested to know how it works, then here is the link
Are you interested to know about EJB 3.0 ? A free PDF of Mastering EJB 3.0 is available on theserverside.com. Check this link to download the PDF
As ajax is getting more and more popular. Everybody wants to make their web applications
ajax enabled. So in my first blog I decided to start with ajax.
So let's first start with what is ajax ?
Using Ajax the whole web page is not required to be loaded again and again. Only the dynamic section gets loaded which gives a flicker free experience to end user and it's faster as only the changed data are transferred from server to client not the whole html page.
Let's say you want to add a stock ticker in your web site. So you need to add a ajax component for stock ticker in your webpage which will be updated automatically by getting data from server without loading your web page again and again. Let's talk about a live cricket score card webpage where the webpage gets refreshed in a particular time interval. So by using ajax you can only change the necessary data like score and balls without updating the whole web page.
There are some very interesting ajax applications available now like Google Map, Google mail and also yahoo mail beta. Check yahoo mail beta which is a ajax version of yahoo mail. You will get a feeling of thunderbird/outlook express though the beta is little slow. And also if you have not yet checked google pages and google spreadsheet, check them now. I was really amazed when I saw google spreadsheet. It's like you are using MS excel in browser. Isn't it cool.