I\'m trying to create a simple webapp with a search Page. I have implemented CRUD part and it\'s working. I\'m new to coding. Having trouble with the search option. Error - \"ja
You have to set the criteria as parameters to get result in ItemsDAOImpl
public List searchitems(String category_id, String publsiher_id) {
return sessionFactory.getCurrentSession().createQuery("from Items E where E.category_id = :category_id AND E.publisher_id= :publisher_id")
.setParameter("category_id", category_id)
.setParameter("publisher_id", publsiher_id)
.list();
}
In your searchResult.jsp
you are iterating over listItems2
but you added is attribute as items
in your controller.
Change
to
On an other note, please name the entities properly. Entity name should be Item
and collection name should Items
. But do that later, first try to fix the current problem.