Web Service requiring a Login
Can someone point me to a tutorial or example that shows how I might create a lightweight web service, using the server code that is built-in to Java 6, that requires a simple login before some of the APIs can be used.
In other words I have a simple web service that has some public APIs that anyone can call, and some restricted APIs that should only be callable after logging in (once). E.g. if I had a simple library service, everyone would be allowed to fetch the list of books, but only people with an admin password would be allowed to add more books to the list.
I don't want to have to change all of my APIs to take a password or security token as a parameter (even though I suspect that the solution will have that happen behind the scenes). I want to have the client call a single login(char  password) API or something similar and then have access to all of the restricted APIs after that.
Thanks in advance,