This might be very basic, but I'm still struggling with this.
I got a struts webapp with MySQL and JDBC Realm.
So the user logs in with his customerId and password.
How do I (in my action) get this customerId (login looks it up in UserAccount table) and compare it with customerId from the Customer table.
I use Hibernate for database persistance.
Is something like request.getParameter gonna work, or should I just "set" and "get" customerId?
So my action has to get this customerId that logged in and use it for the following fuction in my Service (Business) class:
List result = null;
Query query =
session.createQuery(
"select Mortgage.mortgageid from Mortgage in class com.test.hibernate.Mortgage where Mortgage.customer=:customerid");
query.setParameter("customerid", customerid);
result = query.list();
return result;
How do I do this and is my approach correct?