01
Aug 10

Struts 2 test enum

In my Struts 2 app I needed to check for an enum value in the jsp. Using the struts <s:if test=”"> tag this can be done :

<s:if test=’#role.toString()!=”PAID”‘></s:if>

Hope this helps out someone. What I’m doing is getting the string representation of the enum and comparing the same. I did not know we could do a toString() here, hence thought of blogging about it!


22
May 10

How to dynamically call javascript functions

I’ve had a lot of moments when I needed to call a javascript function dynamically. By dynamic function call in javascript, I mean when you do not know the function name to be called before hand i.e. the function name to be executed is provided at runtime.

All you need to do is – window["functionname"]();

Yeah, that’s all! Here functionname would be replaced with the name of your function. As always, I’ll provide a working example so that there is no confusion as to how to make dynamic function calls in Javascript.


13
Jul 09

How to remove Active Desktop Recovery screen

  1. Go to Run and type regedit
  2. Now navigate to this path – HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components
  3. You would find a key named DeskHtmlVersion
  4. Right click the key and select Modify
  5. Under the label Base, select the radio button Decimal
  6. Change Value data to 0
  7. Click OK

This should do the trick. If the screen doesn’t go then try restarting your PC for the changes to take effect.