Monday, March 29, 2010

JSTL madness

I was working on a Java webapp that uses JSTL v1.2 when I hit this JSTL issue. It took me some time to find a work around. Here is the issue: I had a bean that exposes a property called "name". When I tried to output name in jsp using <c:out value="${myBean.name}" /> I always get my webapp context name. Then I came across this article where I saw "The expression language unifies the treatment of dot (.) and bracket ([]) operators. Therefore, ${customer.name} is equivalent to ${customer["name"]}." I tried <c:out value="${myBean["name"]}" /> and got the correct value in jsp. Still not sure why ${myBean.name} didn't work and ${myBean["name"]} worked.

Friday, January 16, 2009

Authenticode signing of windows binary from non-windows platform

After I switched OS for my development from Windows to Mac, I always try to find options that minimize the need for starting Windows on VirtualBox. I had to use Windows for digitally signing exes and dlls. Today I found osslsigncode to sign windows binaries on non-windows platform. One less reason to boot Windows and it is much quicker than on Windows :) Here is how I did it on Mac: 1. Download source zip, unzip, compile and install osslsigncode from http://sourceforge.net/projects/osslsigncode/
cd osslsigncode-1.3 ./configure make make install
2. Generate spc and private key files in DER format from .p12 file
openssl pkcs12 -in CodeSigning.p12 -nokeys -clcerts -out CodeSigning-CL.crt.pem openssl pkcs12 -in CodeSigning.p12 -nokeys -cacerts -out CodeSigning-CA.crt.pem openssl pkcs12 -in CodeSigning.p12 -nocerts -nodes -out CodeSigning-CL.key.pem openssl crl2pkcs7 -certfile CodeSigning-CL.crt.pem -certfile CodeSigning-CA.crt.pem -nocrl -outform DER -out CodeSigning-CL.spc.der openssl rsa -in CodeSigning-CL.key.pem -outform DER -out CodeSigning-CL.key.der
3. Now sign the binary
osslsigncode -spc CodeSigning-CL.spc.der -key CodeSigning-CL.key.der -n "Description" -i "http://www.mydomain.com" -in file.dll -out signed-file.dll

Friday, April 11, 2008

Adobe AIR Application Updater Class

Adobe AIR provides the necessary APIs to implement auto-update for AIR application. You can find an as3 class here that checks for updates at an URL and trigger the application update when a new version is available.

Tuesday, April 1, 2008

as3 Password Strength Meter

I was looking for a password strength meter for my Adobe AIR application and found one written in JavaScript here. It was fairly trivial to convert it to as3. You can see as3 version of it here. Right click on the app to view source.