JSP JSTL Using varStatus to Add CSS Class On Last Element

Often when iterating a collection to display it on table specific css class need to be added to the last row for styling purpose, eg:


Jim
34


Bob
30


Susan
28

This can be achieved on JSP JSTL core tag by using varStatus attribute:


  
    ${user.name}
    ${user.age}
  

On varStatus you define what is the variable name which will hold the loop iteration status. This variable then contain information whether or not we’re on the last iteration, and place specific content accordingly. See the javadoc reference for LoopTagStatus for more info.

The question mark and colon syntax ${status.last ? 'class="last"' : ''} is similar to standard Java syntax. It will print the content class="last" only if status.last is true (ie: we’re on the last iteration of loop)

LogMeIn Hamachi Offline After Logging Out From RDP

I’ve noticed this behavior for a while, and did some searching over the internet. I found this post from hamachi forum about how to prevent hamachi going offline when RDP session is logged out’

So as a workaround you can log off your RDP without closing the session creating a shourtcut in your desktop directed to “%windir%System32tscon.exe RDP-Tcp#0 /dest:console” and run as administrator. This will log you off and leave the session open. Just saying.

So far this solution seem to work for me, need to figure out what will happen when another user logs in into the PC.

Windows 7 Unable to Import Trusted Root Certification Authorities

Windows has its own trusted root CA certificates (which is also used by Google Chrome browsers). If your company is running your own internal CA, an additional CA certificate has to be added to it.

I encountered a very strange problem where everytime I import it via certmgr.msc the dialog says The import was successful but the certificate was never imported.

Solution 1: Use Administrator Elevated Privilege

  1. Click on windows icon -> Search for cmd
  2. Right click cmd.exe -> Run as Administrator
  3. From the command prompt, run certmgr.msc
  4. Continue with the import process

Solution 2: Edit Group Policy on Domain Controller

It is common for PCs in office environment to be connected to a network domain. The default domain policy is to disallow users from adding their own trusted root CA certificate.

To get around this problem, use group policy management editor on your domain controller and find **Certificate Path Validation Settings**. Update the settings into following:

cert_import2

See this Microsoft article for more info.