Tuesday, December 15, 2009

jboss tools 3.1M4 code assist/content assist not working with JSF core and html?

I was playing with jboss tools 3.1M4 and only found out that I am not getting content assist (CA) for the JSF core and html tags. All other namespaces work fine, like richfaces, seam, ajax4jsf etc. How could that be?

My first thought was that the TLDs for core and html are missing. So I manually added the core and html XSD into the XML catalog, restarted eclipse, didn't do it.

Next I found a couple wiki pages (here and here) talking about how content assist works in jboss tools 3.1. They are good how-to but not helping me out. I was ready to dive into the source code and examine the Knowledge Base CA processors.

Then something stroked my mind: is it because my project is not considered JSF projects? I right clicked my project and in the Jboss Tools menu selected "Add JSF Capabilities...", and voila, that made all the difference.

I spent about 3 hours trying to figure this out. This reminds me again: more often than not the solution is much simpler than one imagined.

Thursday, September 24, 2009

keep aventail vpn working after kernal upgrade

I made aventail vpn client working a while back, here is the note I made.

But after each kernel update, the client will break due to the new kernel comes with a newer version of the openssl library.

Luckily the aventail client is looking for a specific version of ssl library, 0.9.7 being specific. so it is easy to make it work again. Here are the scripts:

Voila, got vpn client again!

Tuesday, May 19, 2009

aventail vpn under k/ubuntu 9.04 fixed

Just fixed my vpn issue with kubuntu 9.04. Actually the solution is not limited to k/ubuntu, google results showed that several other distros have the same issue too.

The symptom: through the web client, I am able to login, get web access, then get web and client/server access, but the Aventail OnDemand Tunnel shows status error, without any details. Or in the binary console client, you got DoHandShake Failed message.

Ben Smith got a great post
which eventually helped me solve my issue. Several points to watch out:

  1. Most importantly, try to compile different versions of openssl if one version didn't work, not necessarily a newer version. I started with 0.9.8g, then tried 0.9.8k without luck, then tried 0.9.8i and it worked. Dont ask why becuase it's way over my head.
  2. Make sure your aventail binary client's version matches your vpn server's version
Hat off to Ben, :)

Thursday, January 29, 2009

JSF converter implementation notes

SEAM's built-in converters are big time-savers, especially the s:convertEntity and s:convertEnum. Now the needs of rolling out customized JSF converters are few and far between, I just want to jot down the patterns I had used in case I forget.

  1. take the entity's primary ID as string, and load it from persistence media by ID to convert back to object

  2. implement an algorithm that can encode the object into a unique string, and reconstruct the object by parsing the string

  3. Construct a map of strings and objects. Because converters are instantiated on demand, you have to save the map in a backing bean whose life-cycle spans over requests. The map is nested in the h:selectOneMenu component using f:attribute tag, so that the converter can get a handle of it.

SEAM Howto - end conversation and go back to the previous page

In web application it is often desirable to provide a "Cancel" button in a function area which will redirect the user back to the page they come from.

In SEAM if the function area is wrapped by a conversation, then there are two ways to archive this navigation effect, depending on whether or not you need to do clean up when ending the conversion.

If there is no clean up to be done, you can use s:link or s:button as shown in the example below. The action is invoked first. The view attribute is rendered if redirect did not happen after the action invocation.

If there is clean up to be done, you can archive this in pages.xml file with a navigation hack.

In your pages.xml: