Accessing MySQL Through Struts2

  1. Modify your class task done on Sept 17 so that the following request does one of two things:

    http://localhost:8080/social/login?id=aaa&password=bbb

  2. If user with the id and password exists, add one to its login counter and return page contain id:password:counter; or
  3. 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
  4. 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.
  5. You will need to create a HibernateUserManager to support access to reading/updating/searching for specific users.
  6. Update your struts.xml to include a new login action
  7. Any illegal requests should return a error page.