-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: where should I close session in jsp ?
PostPosted: Fri Dec 26, 2003 4:12 am 
Beginner
Beginner

Joined: Sun Nov 16, 2003 9:30 am
Posts: 20
Hi all ,

I use a struts action to retrieve the products from db and put java.util.List in request. In jsp:

<c:forEach items="${products}" var="product">
<tr>
<td><c:out value="${product.id}"/></td>
</tr>
</c:forEach>

I am supposed to do session.close() at the end. However, this seems not making sense as I open the session in my Action class and putting session.close seems to putting something not related to the view. Please advise.

Thanks.

Perseus


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2003 6:53 am 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
The best thing I suppose is to implement Filter which opens and closes session. This filter will open sesion before your Struts action servlet receives control and closes it when rendering of JSP page is finished.

An example of implementation can be found here - http://www.hibernate.org/43.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.