I want do display a login link when the user isn\'t logged in and a logout link when the user is logged in. I\'m using container managed security as defined in web.xml
This depends on your definition of "logged in". Usually you can login an user in your application by implementing your own login mechanism. Otherwise you are using some container dependent mechanism which your server will take care of.
For the container managed method you can usually check FacesContext with its ExternalContext.
FacesContext.getExternalContext().getRemoteUser();
You can put that method into a helper bean and check it with the rendered attribute of your link component.
If you implement your own system its totally up to you.