This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes logic:iterate pls any body help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:iterate pls any body help me" Watch "logic:iterate pls any body help me" New topic
Author

logic:iterate pls any body help me

Gopnan
Greenhorn

Joined: Sep 13, 2007
Posts: 15
Hi friends,
I am new to Struts, i get one collection object value(like vector) and put that values in logic:iterate but i have some error message try this. any body help me...

my error is

javax.servlet.ServletException: Cannot find bean loginForm in any scope
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.data$jsp._jspService(data$jsp.java:288)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)


root cause

javax.servlet.jsp.JspException: Cannot find bean loginForm in any scope
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:277)
at org.apache.jsp.data$jsp._jspService(data$jsp.java:134)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)

My code is

try{
con = dataSource.getConnection();
st = con.createStatement();
if(username.length()>0 && password.length()>0){
login log = new login(st);
user=log.userChecking(username,password);
if(user)
vec = log.getRecords();
lf.setVect(vec);
lf.setLogin(username);
return mapping.findForward("success");
}
}catch(Exception e){
System.out.println("Error "+e);
}

In jsp

<logic:iterate id="result" name="loginForm" property="vect" >
<tr>
<td><bean:write name="result" property="name"/></td>
<td><bean:write name="result" property="address"/></td>
<td><bean:write name="result" property="phone"/></td>
<td><bean:write name="result" property="dt"/></td>
</tr>
</logic:iterate>
Patricia Samuel
Ranch Hand

Joined: Sep 12, 2007
Posts: 300
What are you expecting to iterate here. name ="loginform"???
As per my understanding to code , i think you are not getting any list.
Ranjit Gopinathan
Ranch Hand

Joined: Jul 03, 2007
Posts: 46
Post the struts-config file and the entire action class method.
Gopnan
Greenhorn

Joined: Sep 13, 2007
Posts: 15
Hi Ranjith,

I send my struts-config and action methods with this mail. please give some suggestion what can i do for?

struts-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<data-sources >
<data-source key="org.apache.struts.action.DATA_SOURCE">
<set-property property="password" value="" />
<set-property property="minCount" value="1" />
<set-property property="maxCount" value="4" />
<set-property property="user" value="" />
<set-property property="driverClass" value="sun.jdbc.odbc.JdbcOdbcDriver" />
<set-property property="description" value="Struts Test" />
<set-property property="url" value="Jdbc dbc river={Microsoft Access Driver (*.mdb)};DBQ=C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\Struts\StrutsDB.mdb" />
<set-property property="readOnly" value="false" />
<set-property property="autoCommit" value="false" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>

<form-beans >
<form-bean name="loginForm" type="LoginForm" id="logtodata">
</form-bean>
</form-beans >

<global-exceptions />
<global-forwards />
<action-mappings >
<action attribute="LoginForm" name="loginForm" path="/register" scope="request" type="LoginAction" parameter="log" >
<forward name="success" path="/data.jsp" />
</action>
</action-mappings>

<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>

LoginAction.java

import javax.mail.Session;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.Globals;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.sql.DataSource;
import java.util.Vector;

public class LoginAction extends Action {
Connection con = null;
Statement st = null;
ResultSet rs = null;
boolean result = false;
Vector vec = new Vector();
int id = 0;
String name = "";
String address = "";
int phone = 0;
String dt="" ;
boolean user ;

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public String getDt() {
return dt;
}

public void setDt(String dt) {
this.dt = dt;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getPhone() {
return phone;
}

public void setPhone(int phone) {
this.phone = phone;
}

public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
LoginForm lf = (LoginForm)form;
HttpSession session = request.getSession();
String username = lf.getLogin();
String password = lf.getPassword();
DataSource dataSource = (DataSource) servlet.getServletContext().getAttribute(Globals.DATA_SOURCE_KEY);
try{
con = dataSource.getConnection();
st = con.createStatement();
if(username.length()>0 && password.length()>0){
login log = new login(st);
user=log.userChecking(username,password);
if(user)
vec = log.getRecords();
lf.setVect(vec);
lf.setLogin(username);
return mapping.findForward("success");
}
}catch(Exception e){
System.out.println("Error "+e);
}
return mapping.findForward("failure");
}
}

login.java

import java.io.*;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionMapping;
import javax.sql.DataSource;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class login {
Statement st = null;
ResultSet rs = null;
DataSource dataSource;
ActionMapping mapping=null;
Vector vec = new Vector();
boolean user =false;
String name="";
String address="";
int phoneno=0;
String datee="";

login(){
}

public login(Statement st){
this.st = st;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public String getDatee() {
return datee;
}

public void setDatee(String datee) {
this.datee = datee;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getPhoneno() {
return phoneno;
}

public void setPhoneno(int phoneno) {
this.phoneno = phoneno;
}

public boolean userChecking(String username,String password){
try{
String query = "select username,password from tbluser where username='"+username+"' and password='"+password+"'";
rs = st.executeQuery(query);
if(rs.next()){
user = true;
return user;
}

}catch(Exception e){
System.out.println("Error "+e);
}
return user;
}

public Vector getRecords(){
LoginAction la = new LoginAction();
try{
String query1 = "select * from tbldata";
rs = st.executeQuery(query1);
while(rs.next()){
la.setName(rs.getString("name"));
la.setAddress(rs.getString("address"));
la.setPhone(rs.getInt("phoneno"));
la.setDt(rs.getString("date"));
vec.addElement(la);
}
}catch(Exception e){
System.out.println("Error "+e);
}
return vec;
}
}

LoginForm.java

/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import java.util.*;

public class LoginForm extends ActionForm {
private String password;
private String login;
private Vector vect;
private List list;

public List getList() {
return list;
}

public void setList(List list) {
this.list = list;
}

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
return null;
}

public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getLogin() {
return login;
}

public void setLogin(String login) {
this.login = login;
}

public Vector getVect() {
return vect;
}

public void setVect(Vector vect) {
this.vect = vect;
}
}

data.jsp

<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-display.tld" prefix="display" %>

<html:html>
<head>
<title><bean:message key="login.title" />
</title>
</head>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Address</th>
<th>Phone No</th>
<th>Date</th>
</tr>
<logic:iterate id="result" name="loginForm" property="vect" >
<tr>
<td><bean:write name="result" property="name"/></td>
<td><bean:write name="result" property="address"/></td>
<td><bean:write name="result" property="phone"/></td>
<td><bean:write name="result" property="dt"/></td>
</tr>
</logic:iterate>
<table>
</body>
</html:html>
Ranjit Gopinathan
Ranch Hand

Joined: Jul 03, 2007
Posts: 46
<action attribute="LoginForm" name="loginForm" path="/register" scope="request" type="LoginAction" parameter="log" >


if you define the attribute name , that name is used to look up the form bean.

<logic:iterate id="result" name="LoginForm" property="vect" >
<tr>
<td><bean:write name="result" property="name"/></td>
<td><bean:write name="result" property="address"/></td>
<td><bean:write name="result" property="phone"/></td>
<td><bean:write name="result" property="dt"/></td>
</tr>
</logic:iterate>

Try this..and let us know

-HTH
Gopnan
Greenhorn

Joined: Sep 13, 2007
Posts: 15
Hi Ranjith,

Thank you very much, Now it's working fine. Could you say, how to set that same type collection values in to a display table Tag. Actually In my jsp code i wrote these

<display:table property="vect" name="loginForm" align="center" >
<display:column property="name" title="Name" />
</display:table>

but i raised these exeception

org.apache.jasper.compiler.CompileException: /data.jsp(25,1) Unable to load class org.apache.taglibs.display.TableTag
at org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:139)
at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.init(JspParseEventListener.java:829)
at org.apache.jasper.compiler.JspParseEventListener.addGenerator(JspParseEventListener.java:153)
at org.apache.jasper.compiler.JspParseEventListener.handleTagBegin(JspParseEventListener.java:1039)
at org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListener.java:221)
at org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListener.java:216)
at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:878)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:892)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:214)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)

can you give me a some suggestions.
sandeep kumar vanama
Greenhorn

Joined: Sep 26, 2007
Posts: 4
hi
sandeep kumar vanama
Greenhorn

Joined: Sep 26, 2007
Posts: 4
hai
I think you have to give scope attribute in the <logic:iterate> tag and what ever the scope value you give for example request,you should put your collection in that request as,
request.setAttribute("collectionKey","collectionName");

and in the jsp where you are iterating through <logic:iterate > tag you have to give name="collectionKey" scope="request" as,

<logic:iterate id="idname" name="collectionKey" scope="request" >
<bean:write name="idname" property = "beanProperty"/> </logic:iterate>

i have tried this and its working...
sandeep kumar vanama
Greenhorn

Joined: Sep 26, 2007
Posts: 4
hai
I think you have to give scope attribute in the <logic:iterate> tag and what ever the scope value you give for example request,you should put your collection in that request as,
request.setAttribute("collectionKey","collectionName");

and in the jsp where you are iterating through <logic:iterate > tag you have to give name="collectionKey" scope="request" as,

<logic:iterate id="idname" name="collectionKey" scope="request" >
<bean:write name="idname" property = "beanProperty"/> </logic:iterate>

i have tried this and its working...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logic:iterate pls any body help me
 
Similar Threads
Date difference, with the table containing null values for date
BeanUtils.populate
Oracle Connection from class used by Servlet
jdbc error....
i got same exception