This blog is mainly about Java...

Wednesday, November 25, 2009

s:convertDateTime

In the Seam documentation there is very little information about this tag.
In the documentation, there is only one example:
<h:outputText value="#{item.orderDate}">
   <s:convertDateTime type="both" dateStyle="full"/>
h:outputText>

This doesn't really say much. However, after some googling, I can explain some of the attributes, and what is actually useful to use.
If you want to show both date and time: dd-MM-yyyy hh:mm:ss you can use type="both" and dateStyle="full". If you want to show only date. Use type="date".

You choose from a range of different dateStyle.
default                   May 14, 2007 2:35:45 PM ( Default Value)
short                     5/14/07 12:55:42 PM
medium                 May 14, 2007 2:42:36 PM
long                      May 14, 2007 2:41:08 PM
full                        Monday, May 14, 2007 2:39:56 PM


However what I have found the most useful is just to use the pattern attribute together with the type.
So if you want the style 14.07.2009 you just write

<h:outputText value="#{item.orderDate}">
   <s:convertDateTime type="both" pattern="dd-MM-yyyy"/>
h:outputText>
And you are set to go! 

Monday, November 23, 2009

Axis 2 gotcha

Just wanted to give a quick GOTCHA I discovered with Axis 2. The other day I wanted to install and use lombok (which is AWESOME by the way).

However lombok needs Java 6 to run, and my WebService was compiled with Java 5, so I changed to Java 6, recompiled, but obviously forgot to recompile the WebService client stubs.
 I didn't get any exception that remotely told me that I had a class version issue. However, I got this exception:
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
After reverting back to Java 5, everything worked just fine. So just a heads up.

Friday, November 20, 2009

Seam / Infinispan meetup in Devoxx

So I just returned from the Seam / Infinispan meetup here in Devoxx and there where a few GOTCHA that I will come back to.

Firstly, the meeting it self was pretty awesome. Although I feel that the Seam discussion wasn't that coordinated as the Infinispan talk. There were too much focus on Weld, but I guess thats not surprising since Weld was just recently released, and most Seam developers except poor Norman Richards, where working on Weld to get it finished before the deadline.
Don't take my words literally, Norman might have done some work towards Weld for all I know, but he was at least the only one working on Seam 2.

Anyways, the ones from the Seam team who where present (forgive me if I forget someone) where: Pete Muir, Dan Allen, Norman Richards, Shane Bryzak and Christian Bauer.
Dan held a quick intro on Seam, for the 3 people who didn't know what Seam was, and then Pete talked a bunch about Weld, and finally Dan closed with showing a very cool testing framework which I cannot remember the name of now which will be implemented for Seam 3, and also Rest on Seam. Of course with a lot of Q&A in between.

So finally I got a chance to speak with Dan, Norman and Pete. I really wanted to have a chat with Shane as well, but unfortunaltly by the time I went to get a beer and come back he was gone. :-(
First I got a chance to ask Dan about the strange behaviour I found regarding injection of a stateless EJB in Seam, discussed here , and he confirmed what I suspected all along, that it was infact a bug in Seam. Now, I he didn't actually say "That is a bug" per say, but he did say "If that doesn't work, it is a bug in Seam". But from my experience I can safely conclude that this is a bug in Seam.
Before you say "Hey, why don't you file a JIRA on it", I will tell you why I will not.
After talking with Pete, I discovered that infact there WILL BE NO MORE releases of Seam. Meaning, even if there are any bugs, or even if someone in the community upload a patch, or even some core devel0per fix the bug in the Seam 2.2 branch, there will be no official release of it. You can however checkout a version of that fix and build binaries for your self.
I know, pretty lame and to be honest a big surprise from my part. But Pete did explain why, and the reason is that before shipping an official release, it has to go to the QA team for testing, and probably some other branches and this takes up rescources that JBoss doesn't want to commit to. Instead they want to focus on the development and shipping Seam 3, which is planned to come around march 2010.
So you must ask your self "What about us who are using Seam 2.x and really need to fix this and that issue? Is all hope gone, other than fixing it our selves and running a build?" The answer is no. If you REALLY want something, basically all you have to do, is buy a support deal from JBoss or a certified JBoss partner (as we are), and ask them to fix it. JBoss will then put resources into fixing that and actually commiting the fix in the branch so that it is available for everyone to checkout and build, however, they still will not release a version of that fix. You have to build it your self.

Lastly, this blog post deserves to be mentioning what Seam 3 will look like. Though this is not official or final, it is what I know has been discussed and agreed upon.
Seam 3 will be what is missing from the Java EE 6 stack. Everything thats sort of extra that didn't get into the spec. It will obviously contain all the pdf, rss, excel goodies we are familiar to from Seam 2, including JBPM 4 and Drools 5 support. Not to forget all the goodies that comes with Java EE 6, Bean validation, Servlet 3.0, EJB 3.1, JPA 2 and so on. It will also be modular based, meaning, that if you only need certain parts of Seam, then it is no need to get anything else which is irrelevant to you. There is probably more that I have forgotten, but Pete will blog about this pretty soon.
Lastly, I want to mention that I did try to encourage the people to participate on the seam forums, and help people that are struggling with their Seam 2.x apps. Because face it; those people are most likely to move to Seam 3 and Weld, and if you want them to do that, you should try to make the learning curve of Seam 2.x as little as possible.
Pete did agree, however he did say that the reason why he couldn't reallly encourage the core developers to use more time on the forums is because of all the time they spent on getting Weld finished. 14 hour(!) days jikes. But hopefully in the future, they will have more time to help the users out there.

Good night from Devoxx.

Labels