If I understand your problem is that you want to set a Session attribute in the onlcik event of an <a>?
If this is correct I just want to tell you that this is impossible because the javascript is executed in the client browser. In this case
you should send the hostname as a request parameter, in order that the Server.do action could set this parameter in the session scope.
Hope this helps.