This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I am using <logic:iterate> to display dynamic retrieved data. but the data is not displayed please help me. I am pasting my code below. I am using Struts and Hibernate.
Since you're using Struts 1, Action classes must be coded as thread-safe. You should therefore not use any instance variables in your action class, which means you should make listLoginData a local variable.
The reason you're not getting any data in the JSP, however, is that your action class does not place the data in any scope that can be retrieved by the JSP. Your JSP is expecting a bean of type Celebrity that has a listLoginData property to be in request scope, when your action class has placed to no such bean in request scope.
It almost looks like you're trying to create some strange hybrid of Struts 1 and Struts 2. In Struts 2, Action classes do have data properties, but there is no ActionForm class, and it uses s:xxx tags rather than bean:xxx or html:xxx tags.
My problem is solved. But i am confused a bit I am pasting my code again will you please tell me whether i am following the right rules of struts or i am still creating a hybrid of struts1x and struts2. ops: and also I now know what you wanted to say when you said that Action classes must be coded as thread-safe. So I must remove the instance variable and make it local.
Thanks again but please try and solve my problem about tiles mentioned in the previous post.
I am using struts1.3.10
**********************************
This is my Action class
**********************************
public class ViewCelebrity extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)throws Exception{
List listLoginData = new ArrayList();
SessionFactory sessionFactory;
Session session;
Transaction transaction;
Configuration configuration;
Query query;