JSR-299 Web Beans Early Draft
Gavin has made the Early Draft of JSR 299 available from his blog, go get it and please send feedback (more info available in Gavins post).
Edit, the Early Draft is now available from the JCP site.
Web Beans
In case someone missed last weeks post from Gavin about the JSR299, be sure to take a peak since there are some really nice features, and should give you a better understanding of what to expect when we hit public draft.
- Web Beans Sneak Peek Part I: Introducing Web Beans
- Web Beans Sneak Peek Part II: Injection, binding annotations and component types
- Web Beans Sneak Peek Part III: Declaring components using XML
- Web Beans Sneak Peek Part IV: Scopes, contexts and resolver methods
- ..And Gavin’s comments on comments
Netbeans, Subversion and Mac
NetBeans has SVN support pretty much out-of-the-box, but on OS X you will be presented with the not so obvious message
NetBeans Subversion support requires Subversion 1.3 executable!
Install Subversion 1.3 (http://subversion.tigris.org) or later,
add it to PATH,
test by running ’svn –version’ from command line, and
finally restart IDE, please
Since I apparently has forgotten how I made it work before here is the instruction for future reference, hopefully this will save me (and perhaps others) from some frustration.
- Fire up a terminal
- Navigate to your Netbeans installtion folder like
cd /Applications/NetBeans5.5.app/Contents/Resources/NetBeans/bin - Open the netbeans file in your favorite editor
- On the first line (after comments) add
PATH=$PATH:/usr/local/bin:/usr/local/sbin
export PATH - Save the file, and restart NetBeans
Your all set!
JSF tags reference
While working on some custom renderers last week I one again found myself searching for the Component Type and Family for any given renderer, so here is a compilation of render-types for future reference.
Say what you want about JSF, but the concept of renderers is a feature I really like, and is one area where JSF actually shines (No this is not intended as flame bait).
| Tag Name | Component Family | Component Type | Renderer Type |
|---|---|---|---|
| h:column | javax.faces.Column | javax.faces.Column | - |
| h:commandButton | javax.faces.Command | javax.faces.HtmlCommandButton | javax.faces.Button |
| h:commandLink | javax.faces.Command | javax.faces.HtmlCommandLink | javax.faces.Link |
| h:dataTable | javax.faces.Data | javax.faces.HtmlDataTable | javax.faces.Table |
| h:form | javax.faces.Form | javax.faces.HtmlForm | javax.faces.Form |
| h:graphicImage | javax.faces.Graphic | javax.faces.HtmlGraphicImage | javax.faces.Image |
| h:inputHidden | javax.faces.Input | javax.faces.HtmlInputHidden | javax.faces.Hidden |
| h:inputSecret | javax.faces.Input | javax.faces.HtmlInputSecret | javax.faces.Secret |
| h:inputText | javax.faces.Input | javax.faces.HtmlInputText | javax.faces.Text |
| h:inputTextarea | javax.faces.Input | javax.faces.HtmlInputTextarea | javax.faces.Textarea |
| h:message | javax.faces.Message | javax.faces.HtmlMessage | javax.faces.Message |
| h:messages | javax.faces.Messages | javax.faces.HtmlMessages | javax.faces.Messages |
| h:outputFormat | javax.faces.Output | javax.faces.HtmlOutputFormat | javax.faces.Format |
| h:outputLabel | javax.faces.Output | javax.faces.HtmlOutputLabel | javax.faces.Label |
| h:outputLink | javax.faces.Output | javax.faces.HtmlOutputLink | javax.faces.Link |
| h:outputText | javax.faces.Output | javax.faces.HtmlOutputText | javax.faces.Text |
| h:panelGrid | javax.faces.Panel | javax.faces.HtmlPanelGrid | javax.faces.Grid |
| h:panelGroup | javax.faces.Panel | javax.faces.HtmlPanelGroup | javax.faces.Group |
| h:selectBooleanCheckbox | javax.faces.SelectBoolean | javax.faces.HtmlSelectBooleanCheckbox | javax.faces.Checkbox |
| h:selectManyCheckbox | javax.faces.SelectMany | javax.faces.HtmlSelectManyCheckbox | javax.faces.Checkbox |
| h:selectManyListbox | javax.faces.SelectMany | javax.faces.HtmlSelectManyListbox | javax.faces.Listbox |
| h:selectManyMenu | javax.faces.SelectMany | javax.faces.HtmlSelectManyMenu | javax.faces.Menu |
| h:selectOneListbox | javax.faces.SelectOne | javax.faces.HtmlSelectOneListbox | javax.faces.Listbox |
| h:selectOneMenu | javax.faces.SelectOne | javax.faces.HtmlSelectOneMenu | javax.faces.Menu |
| h:selectOneRadio | javax.faces.SelectOne | javax.faces.HtmlSelectOneRadio | javax.faces.Radio |
Boosting you productivity in Eclipse using shortcuts
Recently a team member approached me wanting to switch IDE from the corporate standard Borland JBuilder to Eclipse, and she asked if I had some nice advice to boost
productivity. Well using keyboard shortcuts is IMHO a huge productivity booster, and I compiled a list of my 13 most used shortcuts I find useful in my everyday work.
The hard part about shortcuts is that I never seem to be able to say which combination to press, they are just subconscious. Start saving some time, learn them, perhaps not all but everyone of them will save you quite some time over a day of use.
Note: If your using OS X exchange CTRL with the Command key
So buckle up, and start being more productive right now..
Open type (ctrl + shift + T)
This will open up a class in the workspace (or in dependencies such as jar-files), the dialog accepts wildcards (for instance *Action), another nifty feature are the CamelCase notation to quickly open a file, for instance if you want to open the class HotelBookingAction entering HBA´would give you the correct result right away, and save you some typing.

Open Resource (ctrl + shift + R)
Same tip as above, but it works on every resource (.jsp, .properties, .xml etc) in your workspace, same tips for wildcards as above applies.
Navigate to member (ctrl + O)
You know, even if you probably shouldn’t you have some class which is really large, several hundreds of code, maybe even thousands. How do you navigate to a member (method, variable) one option (and most often used) is to search for it using Ctrl + F, it’s really not that efficient, instead use this short cut to list all the methods, to narrow the list start typing the method name navigate to the one you want with the arrow keys and press enter. Even more, press the key another time and it will show you the inherited members.
Go to Line (ctrl + L)
Often you find a line number when digging through stack traces and such, to simply go to a line in the open file press Cmd + L and enter the line number.
Go to last edit (ctrl +Q)
Do you know the scenario when you edit your large class file, and you change something in one method, and want to go to the last thing you edited in before this? Instead of browsing to the previous method, finding the right spot use this command to jump right back to the last edit, use it multiple times to track back in history.
Show type hirarchy (ctrl + T)
This one took me quite some time to find, usually i just jump to the top of the class, find the supertype and hit F3 to open the supertype, with this the power are at your fingertips.
Go to open editor (ctrl + E)
I often keep some 10 editor windows open at any given time (or more), if you want an easy way to switch between open editors try this command, either select the file you want to bring to the front, or start typing to narrow the results down a bit.
Next error/warning (ctrl + +.
This command will cycle through the errors/warnings in the current file, instead of using the Problems view. I tend not to use this so often, the this since the short not that intuitive (easily fixed by remapping, but then I would go nuts when using another machine).
Move block of code (alt + arrow up/down)
Often find yourself copying and pasting code while moving around declarations, or whole block of code? No more, this shortcut will move a line (or block) of code up/down one line much easier and faster than cut’n’paste.
Block comment/uncomment (Shift + Ctrl + /)
Instead of commenting out blocks of code with /* */ use this, it will make every selected line commented out with a // , to remove the comment invoke this again to remove.
Search workspace for references (ctrl + shift + G)
Do you want to know if anyone is calling your method, or using the variable? Find the method, invoke this command and se the results of all references in the workspace.
Reformat code (ctrl + shift + F)
Apply the current code formatting set to the open file, this one is pretty much etched in mine spine doing this just before I commit/save a class.
Organize imports (ctrl + Shift + O)
Do you want to keep you imports nice and tidy, and organized according to the preferences?
JSR 316 a.ka Java EE 6
Posted yesterday were the JSR316, or the umbrella JSR for EE 6. (well it was posted as JSR313 a while ago). So the news?
Included “new” JSRs
As well as updated versions of EJB, JPA, Servlet, JSF, JAX-WS, and the Java EE Connector API.
Good news nonetheless.
Free book on Maven
Andrew Williams posts about the release of his free book on Maven.
Thats right, there is a new guide out there to help all those interested in Maven (or already using it) to get the most out of their build lifecycle. It is indeed the definitive guide and will be regularly updated so it stays that way. This book is produced by my colleges at Sonatype and is a free gift to the Maven community – no registration, no catches. From the front of our site:
Sure, there has been articles around for maven previous, but not as “complete” as this. It made it to my bookmarks anyway.
Weblogic 10 on OS X..
Weblogic, being one of the major player in the Java EE app server space released the first fully certified final release last week (although a fully certified tech preview has been available for a while now.).
Being a longtime Weblogic user (my current project using Weblogic 9.2 to name just one) I decided to give it a spin.
Since BEA doesn’t support OS X I start out by making the beast run on my preferred platform, fortunately its quite easy, and I have previously blogged about it. So here is a quick recap for WLS10.
Firstly download the HP-UX Itanium release (server100_generic.jar)
Start the graphical installer by running
java -Dos.name=unix -jar server100_generic.jar
One installed, go ahead and create a new domain (or upgrade an existing if thats your game), use the wlserver_10.0/common/bin/config.sh to start the wizard.
Voila, your ready to go. Start the new domain and start playing around with WLS10.
And of course, running Weblogic on OSX is not supported by BEA in any way.
My next step is to evaluate the WLS10, to get to know it a bit better. Ill take a existing Java EE app and make it run on WLS 10 (The app is currently in production on JBoss AS, and I’ve previously “ported” it to Glassfish). So hand around for my observations.
Note, by using this approach you will miss out on the platform dependent optimization (namely using native libraries, but this method has served me good in the past).
to be continued…
Update: It has come to my attention that the console may freeze (and the CPU jumps to 100%) when trying to login to the console (I didn’t run into it since I had made theese changes anyway). Change/add the following to bin/setDomainEnv.sh
USER_MEM_ARGS="-Xms512m -Xmx1024m -XX:MaxPermSize=128m"
Mobile JSF Library
Ericsson (yes, not Sony Ericsson) surely surprised me with the release of a framework called Mobile JSF Kit , the kit comes complete with documentation.
Quote from the site
The Mobile JSF (JavaServer Faces) Kit consists of the MobileFaces core library, a developer’s guide and sample applications to help Java EE developers to rapidly develop internet mobile applications.

Skimming through the doc it seems to contain quite allot of nice features, like detecting devices although it especially states that detecting screen size are not possible.
So is the time right to face your enterprise app to the mobile platform? This certainly could make things easier.
JSR299 Session at JavaOne
Gavin & Bob will be holding a JSR299 Session at JavaOne-2007. Don´t miss it!
Session details (as found on JavaOne site).
JSR 299, Web Beans, aims to unify the JavaServer Faces technology-based managed bean component model with the Enterprise JavaBeans (EJB) component model, resulting in a significantly simplified programming model for web-based applications. This session covers
• The background of the Web Beans effort
• Expert group membership
• The purpose and scope of the Web Beans specification
• The Web Beans programming model
• The impact on other JSRs: EJB 3 architecture; JavaServer Faces platform; Java EE
• The current status of JSR 299
• Open issues
• Q&A