I want to do the following things:
My questions are:
I just want a simple and common solution, don't make it complicated.
As is usually the case with authenticated applications (i.e. passwords), keeping it simple usually leads to massive security holes. For starters you may have to use HMAC. Applet's typically can pick up parameters from say page B using parameter tags or in modern applets with jnlp. Once the user/pass reaches the server dynamically generate session keys for the applet and pass them to the applet code via the parameter mechanism i.e as tags in page B or parameters in the applet's jnlp.