tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milan Mrdjen <mrd...@gmail.com>
Subject how to propagate an exception from JAAS to JSP page, and a workaround
Date Thu, 02 Feb 2006 15:52:04 GMT
Hi folks,

I'm using Tomcat and CMA with JAAS.
In my application there are several possible reason why a user can not
login (wrong password, user expired, user locked, etc) and I need to
present a message with the information to user on the JSP page. So I
need to propagate the exception from the JAAS to the JSP page, however
I was not able to do this. Does anybody have any idea how to do this? The
CMA is a must otherwise it's easy…

In the meantime I've come with a workaround and would like to know your
opinion – in my login module, when the exception occurs I store the
information in JNDI, for example I put a HashMap in JNDI and in
HashMap under key "username_password" I store "user expired". Then on
error page I read j_username and j_password (Tomcat does transfer
these along with all request parameters from login page) and I use the
username and password to generate the key and read the message value
from JNDI.

What do you think about the workaround? Do you see any obvious holes?

Thx, Milan
--
mrdjen@gmail.com
mrdjen@tesla.rcub.bg.ac.yu
Mime
View raw message