JSFDays summary

Java No Comments »

JSFDaysI have been to the JSFDays 08 in Vienna for the last three days and know I am starting to sort out all the information I got there.

I did not use JSF in a real project until know although I read the O’Reily book on JavaServer Faces more than three years ago. The main motivation for going to the JSFDays was that I am really unsatisfied with the currently available frameworks for building the UI of Java web applications.

The last projects I worked on mostly used Struts 1.x or Spring MVC. Like in many web projects that are currently under construction there had to be some sort of dynamic behavior and AJAX. So I used prototype, miraculous, jsonlib, ajaxtags and many more. But the whole process took a lot of manual effort and I was not satisfied with this way – although the results were correct.

In his keynote Ed Burns talked about the history of network aware applications. The conclusion of the keynote was that is important to use the ontology of UI styles to put things in buckets – to classify them. In the Q&A session after the keynote everybody agreed that the possibility to render components different for special devices (like mobiles) is not as important as initially thought (this was one of the ideas behind the JSF spec).

For me the keynote made clear what the idea behind JSF really is. It is not just another web application framework like Struts, WebWork, WebObjects or Tabestry. Sun tried to define a standard for how to build components of a web UI. This should allow different vendors to provide components based on the same standard so that developers may choose between them. The problem with JSF standards 1.1 and 1.2 was that it did not define enough to fulfill the users needs. The component frameworks that were created had to add a lot of features “outside” of the specification and this led to the incompatibility problems between the available libraries. The website jsfmatrix.net shows the result of this.

In the second session on Wednesday Jürgen Höller talked about new features in Spring 2.5 and how they could be used in a JSF environment. There were a lot of interesting new configuration options by using annotations I did not know. After the talk a discussion took place about what configurations should be done in external XML files and which configurations are better done with annotations.

Max Katz demonstrated how powerful the JBoss RichFaces are. They include over 70 components and provide nice AJAX features out of the box. It was a really impressing. I definitely have to give the JBoss tools a try when there is time. Max has also done a good comparison of available RIA tools with this article.

Matthias Wessendorf did a nice presentation of Oracle ADF Faces Rich Client. It seems like Oracle has put lot of energy into these components. They allow to create a very rich web interface.

In the fourth session Kito Mann showed us how scripting languages like Ruby or Groovy could be used in a JavaServer Faces application. Kito is running jsfcentral.com, a good place for finding information about JSF. He is also member of the JSF experts group and has written the book JavaServer Faces in Action.

On the second day Thomas Spiegl and Mario Ivankovits talked about JSF@work. They used Orchestra to resolve some common problems of JSF applications. Orchestra provides additional scopes (like a conversation scope) and other things. There is a website containing information about the small project they used for demonstration.

Alexander Jesse showed how he and his team use Selenium, JSFUnit and easymock to test JSF applications. I never used Selenium but it looks good, for me watij did the job.

Manfred Geiler used AOP to extend domain objects so that they could be used in a JSF view. A very interesting way to solve common demands. He is working on a library that will add the required utility classes which will be released as OpenSource.

In the BOF at on Friday some information about the future release of JSF 2.0 was showed. There will be an early draft available by the end of April.

The slides of the presentations are now available on the conference site. I added the pictures I made of the conference to my flickr account.

RIM releases JDE plugin for Eclipse

Blackberry, Eclipse, Java, Mobile, RIM No Comments »

RIMFinally RIM released a a version of its BlackBerry Java development environment as a plugin for Eclipse. It is available under http://www.blackberry.com/go/eclipse as a free download.

My download is already 90% finished and I hope that this will ease development of BlackBerry apps. As an Eclipse fan I was really frustrated about the JDE releases of RIM and I put a lot of effort into getting things to work inside of Eclipse. I will post my experiences in a week or two so check back.

Joining the JSFDays in Vienna

Java, Software No Comments »

JSFDaysI am going to visit the JSFDays held from March 12th to March 14th in Vienna. Among the other speakers I am looking forward to sessions held by Edward J. Burns from Sun and Jürgen Höller from SpringSource.

Thanks to Martin for making me aware of this event.

New FindBugs version available

Eclipse, Java No Comments »

java logoThe final version of FindBugs 1.3.2 was released. I add FindBugs to every Eclipse installation because it is a very useful tool for finding possible problems in my code. The new version 1.3.2 includes a new view listing all bugs in a project by priority. See this blog post for more details.

VIM screencasts

.NET, Eclipse, Java, Tools No Comments »

vilogoAaron postet two screencasts on his blog showing how to use VIM. I really love VIM - I thought about installing the viPlugin for my favorite IDE Eclipse some months ago. Now these videos made me think again - I think I will give it a try. Checkout the two casts:

  1. VIM Screencast 1 - basic usage (navigation, modes, …)
  2. VIM Screencast 2 - commands with motion (yank, change, …)

There is even a vi emulator for you Visual Studio users out there - it is called ViEmu.

Using Apache FOP with Cooktop

Java No Comments »

java logoIn one of my projects we use XSTL transformation and Apache FOP to generate PDF files from XML documents. I am using Cooktop as my favorite free XML/XSLT development and test environment for a long time now. A colleague made me aware that it is possible to make Cooktop use custom XSLT engines for transformation.

I just had to download the most current version of Apache FOP (fop-0.94-bin-jdk1.4.zip), unpack it and copy the directories build and lib into the the folder xslt/fop inside the Cooktop installation directory.

Then I edited the preconfigured engine under Options -> System XML -> Manage XSLT Engines in Cooktop. The attributes exec, installed and the environment variable CLASSPATH had to be changed. Here is my final working configuration:

<XSLT
    name="Apache FOP"
    type="external"
  exec=""%CONFIG%\xslt\fop\fop.bat"
	"!xml!" "!xsl!"
	"!res!"
	"!res-no-ext!.pdf""
    path="%CONFIG%\xslt\fop"
    supported_func="system-property"
    http-support="no"
    installed="yes"
    code-url="http://xml.apache.org/fop/">
      <ENVIRONMENT>
         <ITEM
          name="CLASSPATH"
          value="%CONFIG%\xslt\fop\build\fop.jar;
	%CONFIG%\xslt\fop\lib\xercesImpl-2.7.1.jar;
	%CONFIG%\xslt\fop\lib\avalon-framework-4.2.0.jar;
	%CONFIG%\xslt\fop\lib\batik-all-1.6.jar;
	%CONFIG%\xslt\fop\lib\commons-io-1.3.1.jar;
	%CONFIG%\xslt\fop\lib\commons-logging-1.0.4.jar;
	%CONFIG%\xslt\fop\lib\serializer-2.7.0.jar;
	%CONFIG%\xslt\fop\lib\xalan-2.7.0.jar;
	%CONFIG%\xslt\fop\lib\xml-apis-1.3.02.jar;
	%CONFIG%\xslt\fop\lib\xmlgraphics-commons-1.2.jar" />
      </ENVIRONMENT>
   </XSLT>

The last thing I had to do was to edit the fop.bat file containing the command line that calls the FOP processor. My fop.bat lookes like the following after editing it:

@echo off
start /MIN /WAIT java -cp "%CLASSPATH%"
      org.apache.fop.cli.Main -xml %1 -xsl %2 -pdf %4

echo ^<FRAMESET COLS="*"^> >> %3
echo ^<FRAME src= %4 /^>>> %3
echo ^</FRAMESET^> >> %3

Now it is possible to change the XSLT Engine to Apache FOP and to run the XSL transformation. The resulting PDF is stored in a temporary folder and displayed by a frame inside the result tab of Cooktop.

This tutorial helped a lot getting things going. On some machines of my colleagues we had problems with the CLASSPATH environment variable. The solution was to create the path inside the batch file like described in the tutorial.

My booklist

.NET, Java, Software No Comments »

booksMaybe you have noticed my new booklist widget in the right sidebar. In the last years it occurred very often that somebody asked me if I know a good book on a certain topic. I recommended books to my colleagues, students and friends.

Some weeks ago I thought that it would be easier to have place where I list my favorite books so I could point to the list if somebody asks me. Now this is what I have done with the booklist.

I read all of the books in the list by myself and I really recommend them. Of course every book deals with a special topic but mostly the are related to software development.

In the future I want to do more detailed summaries and recommendations of books I just read.

@Override specification changes in Java 6

Eclipse, Java 1 Comment »

Between Java 5 and Java 6 changes to the specification of @Override have been made. In Java 6 it is possible to add the @Override annotation to methods that implement methods of an interface which is not allowed in Java 5.

I noticed the difference when a friend told me that he had to remove all the @Override annotations to make his Java 6 project compile with Java 5.

The interesting thing is that there is no documentation about this change. The API specification of @Override is exactly the same in both Java versions. I found out that this was forgotten by Sun developers. Peter Ahé, a former developer at Sun, calls it the @Override Snafu.

Spring with AspectJ in Eclipse

Eclipse, Java, Software, Tools 2 Comments »

SpringSome weeks ago I wrote a custom JSP tag for a Spring project I am currently working on. Inside the tag I wanted to use a Spring bean. Soon I realized that this case had to be handled a bit different because the tag is instantiated by the application server and not from the Spring context. Therefore the simple standard injection mechanism did not work.

Using the Spring documentation I found out that I had to use AspectJ for dependency injection in this case. I added the @Configurable annotation to my tag class. I added the required configurations to the XML files:

1
2
<context:spring-configured />
<bean class="net.einwaller.spring.Tag" lazy-init="true" />

To get the required classes in the classpath of my application I had to add the libraries aspectjrt.jar and spring-aspects.jar. The first approach I took for weaving the aspects into my classes was load time weaving. I achieved this by adding the following to the VM arguments of my Tomcat instance:

-noverify -javaagent:pathtojar\aspectjweaver.jar

The noverify option was needed because the version of log4j caused a problem when starting the server without the option. I configured the path to my aspectjweaver.jar as an absolut path.

Having done all these steps I got my application running again but the load time weaving was a bit annoying. I was not able to change the code of my application while the server was running. The Java VM hot code replace did not work anymore. Restarting the server for every change slows down development performance a lot. So I searched for a better solution.

First I installed the AspectJ Eclipse plugin. I wanted to use the AspectJ compiler for compile time weaving of the AnnotationBeanConfigurerAspect. To do so I had to convert the project into an AspectJ project which changes the compiler and adds some project preference pages (RMB -> AspectJ Tools -> Convert to AspectJ Project).

Afterwards I had tried to add the spring-aspects.jar to the Inpath of the AspectJ Build preferences but that did not work. I moved the JAR file out of the WEB-INF/lib folder and tried to add it again - and it worked! Seems like the AspectJ plugin has some problems withe the classpath of the WTP plugin.

Now I got the shiny AspectJ markers at the top of the classes I marked with the @Configurable annotation. The application runs inside the Tomcat after removing the VM arguments for load time weaving and hot code replace works again - perfect!

Eclipse command line argument

Eclipse, Java No Comments »

Eclipse IconWhen working with Eclipse I usually have multiple workspaces I am are working with (different projects, clients, branches, …). I found a useful command line argument that displays the path of the current workspace in the window tittle bar - showlocation. Just add it to your eclipse.ini file, mine looks like this:

-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-Dcom.sun.management.jmxremote

I noticed that showlocation only works when added as the first argument.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in