What is Hibernate in Java? The Hibernate is popular ORM tool developed in Java programming language and it supports all the major Databases. You can switch to another database simply change dialect in the configuration file. The Hibernate framework is free software distributed under GNU Lesser General Public License. In such case, we are getting the value from the user using the JSP file. Example to create web application using hibernate. In this example, we are going to insert the record of the user in the database. It is simply a registration form. This page gets input from the user and sends it to the register.jsp file using post method.
Good Evening, i have an exception called
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
it rises when i tries to get attributes from an ibject thta resides in the session, here's my JSP stmts that get parameters from session attributes:Note: these exception is thrown only when i added the second for loop in my JSP, everything is clear without the second for loop !! please i want to know what these foor loop had make and how to overcome that
Java PlayerJava Player
Browse other questions tagged hibernatejspopen-session-in-view or ask your own question.
![Jsp Hibernate Isproxy Jsp Hibernate Isproxy](http://repository.transtep.com/repository/thirdparty/spring-framework-2.5.5/docs/reference/html_single/images/full.gif)
I am creating an struts hibernate application. I have obtained a list using hibernate query and passed it in action class. But I don't know how to display it in JSP.
I have successfully getting the list on the basis of query.Now I want to display this list in JSP.
I have posted
struts.xml
and the JSP for showing result also.Kindly check. But in JSP nothing is showing up.I am using s:iterate
to show the list. But no luck.Even I have tried printing simple text under s:iterate
, just for testing.But it is also not showing up. POJO class:
Action Class:
Hibernate class:
This is my
struts.xml
in which all actions are defined.For now the action is ByDate
.struts.xml
:This is my JSP for showing list
iterate.jsp
:I have successfully getting the list on the basis of query.Now I want to display this list in JSP.
Sachin SharmaSachin Sharma
3 Answers
Use iterator tag:
Iterator will iterate over a value. An iterable value can be any of:
java.util.Collection
, java.util.Iterator
, java.util.Enumeration
, java.util.Map
, or an array.The code:
Roman CRoman C
Naveen KumarNaveen Kumar
you already globally declare
list variable
and need Getter&Setter method of all.and remove your redeclartion in local.
![Isproxy Isproxy](/uploads/1/2/5/5/125579081/221252588.jpg)
List<FeedBack> list = query.list();
change into list = (List<FeedBack>)query.list();
and coversion should required.add struts library in jsp page,Finally,
harihari