One way you could accomplish this is to check the value returned by the HttpServletTRequest.getUserPrincipal() method. If this returns the value of the authenticated user, the user has been logged in, and so the 'Logout' button could be displayed. When the method returns null, the user is not logged in.
HTH
Nithya
[Message sent by forum member 'nitkal' (nitkal)]
http://forums.java.net/jive/thread.jspa?messageID=348602