If user with the id and password exists, add one to its login counter and return page contain id:password:counter; or
If user with the id and password does not exists, create a new user with the corresponding id, password and login counter set to one, store the user in the database, and return a page contain id:password:counter
You will need to create a User table and User class containing columns/instance variables of the form primaryKey, id, password, counter. Choose your SQL types and Java types accordingly.
You will need to create a HibernateUserManager to support access to reading/updating/searching for specific users.
Update your struts.xml to include a new login action