Wednesday, November 21, 2007

Who is using my system?



If you have a web application, based on Servlets/JSP (JEE), which sits behind the Apache/mod_jk, and you would like to track who is using your system, here is what to do:

1. In the Apache configuration (probably Vhost definition, as in my case), you will need:
        • JkMount /* NAME_OF_YOUR_WORKER
        • JkEnvVar REMOTE_USER "<NOTSET>"
The second entry will pass the information about user logged in on the Apache level down to your web application
2. In your application you can check who is using it, with credentials on the Apache level, with:
        • ${ REMOTE_USER } (JSP/EL)
        • request.getAttribute("REMOTE_USER") (Servlet or JSP/Scriptlets)
3. In your application you can also check who is using it, with credentials on the Tomcat level, with:
        • ${ pageContext.request.remoteUser } (JSP/EL)
        • request.getRemoteUser() (Servlet or JSP/Scriptlets)

That’s it.

Unless, your system is DSpace - where more problems will arise. You will need to, e.g.,
1. The register user is hidden in request.getAttribute("dspace.current.user"), and is of type org.dspace.eperson.EPerson
2. In order to get some human-readable description of this user you can call getEmail() method to get the email of the user.


Sunday, November 18, 2007

Deadly Sins (when using email)


I have just read this post. I subscribe to this opinion. And on the top of his 7 sins:
1. Hanging Questions
2. Buried Requests
3. Wrong Medium
4. Trying to Be Clever
5. Sending Urgent Requests Through E-Mail
6. Bulky Paragraph
7. Playing E-Mail Tag

I would surely put “Attach Huge Emails”. Seriously, this is very annoying. My mailbox is no 5GB+.

Mac vs PC (by Umberto Eco)


…Insufficient consideration has been given to the new underground religious war which is modifying the modern world. It’s an old idea of mine, but I find that whenever I tell people about it they immediately agree with me.
The fact is that the world is divided between users of the Macintosh computer and users of MS-DOS compatible computers. I am firmly of the opinion that the Macintosh is Catholic and that DOS is Protestant. Indeed, the Macintosh is counter-reformist and has been influenced by the ‘ratio studiorum’ of the Jesuits. It is cheerful, friendly, conciliatory, it tells the faithful how they must proceed step by step to reach–if not the Kingdom of Heaven–the moment in which their document is printed. It is catechistic: the essence of revelation is dealt with via simple formulae and sumptuous icons. Everyone has a right to salvation.
DOS is Protestant, or even Calvinistic. It allows free interpretation of scripture, demands difficult personal decisions, imposes a subtle hermeneutics upon the user, and takes for granted the idea that not all can reach salvation. To make the system work you need to interpret the program yourself: a long way from the baroque community of revellers, the user is closed within the loneliness of his own inner torment.
You may object that, with the passage to Windows, the DOS universe has come to resemble more closely the counter-reformist tolerance of the Macintosh. It’s true: Windows represents an Anglican-style schism, big ceremonies in the cathedral, but there is always the possibility of a return to DOS to change things in accordance with bizarre decisions; when it comes down to it, you can decide to allow women and gays to be ministers if you want to…..
And machine code, which lies beneath both systems (or environments, if you prefer)? Ah, that is to do with the Old Testament, and is talmudic and cabalistic…
[ Being a Mac user and a Catholic - I leave no comments to that ;) ]

Tuesday, November 13, 2007

Java6 for Leopard


My two cents - I really miss that - anyone also interested - please put
13949712720901ForOSX
on your web page/blog