Hi, I am trying to iterate the object stored in session using struts nested tag. I am getting an exception javax.servlet.jsp.JspException: Cannot find bean: "" in any scope. What am I missing in the following code. I do not want to have the Action class and action form bean. I have a need to access the session object and display the results. Here is my code and appreciate if some one helps me out.
Regards, Smitha <%@ taglib uri='/tags/struts-bean' prefix='bean' %> <%@ taglib uri='/tags/struts-html' prefix='html' %> <%@ taglib uri='/tags/struts-logic' prefix='logic' %> <%@ taglib uri='/tags/struts-nested' prefix='nested' %> <% List<SubjectInfo> data = DataUtil.getData(); request.getSession().setAttribute("subjectInfo", data); %> <html> <head> <title>TabMenu Demo home</title> </head> <body> <nested:iterate property="subjectInfo"> Subject: <nested:write property="name"/> <br> <nested:iterate property="topicInfo" > Topic: <nested:write property="name"/> <br> Data: <nested:write property="data"/> </nested:iterate> </nested:iterate> </body> </html> public class SubjectInfo { private String name; private List<TopicInfo> topicInfo; public String getName() { return name; } public void setName(String name) { this.name = name; } public List<TopicInfo> getTopicInfo() { return topicInfo; } public void setTopicInfo(List<TopicInfo> topicInfo) { this.topicInfo = topicInfo; } } public class TopicInfo { private String name; private String data; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getData() { return data; } public void setData(String data) { this.data = data; } } public class DataUtil { public List<SubjectInfo> getTestData() { List<SubjectInfo> subjects = new ArrayList<SubjectInfo>(); //First Subject SubjectInfo subject = new SubjectInfo(); subject.setName("Maths"); List<TipocInfo> topics = new ArrayList<TopicInfo>(); TopicInfo topic = new TopicInfo(); topic.setName("Addition"); topic.setData("Data for addition"); topics.add(topic); //Second topic topic = new TopicInfo(); topic.setName("Subtraction"); topic.setData("Data for subtraction"); topics.add(topic); subject.setTopicInfo(topics); subjects.add(subject); //Second Subject subject = new SubjectInfo(); subject.setName("English"); topics = new ArrayList<TopicInfo>(); topic = new TopicInfo(); topic.setName("Adjectives"); topic.setData("Data for adjectives"); topics.add(topic); subject.setTopicInfo(topics); subjects.add(subject); return subjects; } -- View this message in context: http://old.nabble.com/Struts-to-iterate-stored-session-object-tp30732352p30732352.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org