I am new to JSF, I was trying to do simple CRUD application, I added the following
- DAO to access database
- Employee cdi bean with session scope
- search, add and edit jsf pages
when I press on edit button to edit employee. everything goes fine, But because it is session scope, when I try to add new employee the text fields get populated automatically with the data from the last edit employee because they are still there in the session.
Well as trivial solution i tried to downgrade the scope of the CDI bean to be request scope but, in this case, it become invisible to my page, it throws exception that this bean does not exist. so what is the solution for this?