struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oussama Jlassi <oussa...@live.fr>
Subject RE: Cannot find bean: “list” in any scope
Date Sat, 17 Mar 2012 23:22:02 GMT

sorry about the new line but it is removed  when it come to apache struts server now about
he bean here is
test.java
public class test{private int id,tt;private String t;public test(){}public test(int id,String
t,int tt) {this.id=id;this.tt=tt;this.t=t;}
public int getId() {return id;}public void setId(int id) {this.id = id;}public String getT()
{return t;}public void setT(String t) {this.t = t;}public int getTt() {return tt;}public void
setTt(int tt) {this.tt = tt;}}
> Date: Sat, 17 Mar 2012 19:11:21 -0400
> Subject: Re: Cannot find bean: “list” in any scope
> From: davelnewton@gmail.com
> To: user@struts.apache.org
> 
> You had one before, as far as I can tell (your messages are quite difficult
> to read as there are no newlines).
> 
> You do understand that we don't actually know anything about your beans,
> right? *is* there a property called "id"?
> 
> Either way, that part of it doesn't appear to be a Struts issue.
> 
> Dave
> 
> On Sat, Mar 17, 2012 at 6:55 PM, Oussama Jlassi <oussamaj@live.fr> wrote:
> 
> >
> > why it is impossible no hope at all can i have a correction of my code as
> > i said before i want to list table named test through struts 1.3 and
> > hibernate4
> > struts-config.xml
> > <?xml version="1.0" encoding="ISO-8859-1" ?>    <!DOCTYPE struts-config
> > PUBLIC          "-//Apache Software Foundation//DTD Struts Configuration
> > 1.3//EN"          "http://struts.apache.org/dtds/struts-config_1_3.dtd">
> >    <struts-config>        <action-mappings>                <action
> > path="/hib1" type="Hib1Action">                <forward name="success"
> > path="/list.jsp"/>         </action>        </action-mappings>  
 <plug-in
> > className="HibernatePlugIn"/>    </struts-config>
> >
> > > Date: Sat, 17 Mar 2012 18:33:19 -0400
> > > Subject: Re: FW: Cannot find bean: “list” in any scope
> > > From: davelnewton@gmail.com
> > > To: user@struts.apache.org
> > >
> > > I'm not sure I understand how taking out of scope would help; not knowing
> > > anything about the bean in question, it's impossible to help--but on the
> > > Struts side of things, it looks like it's working when it's in scope.
> > >
> > > Dave
> > >
> > > On Sat, Mar 17, 2012 at 6:19 PM, Oussama Jlassi <oussamaj@live.fr>
> > wrote:
> > >
> > > >
> > > >
> > > > i supposei work with the setter getter because when i commented it and
> > > >  use  request.setAttribute and i get the message
> > > > Etat HTTP 500 -type Rapport d'exceptionmessagedescription Le serveur a
> > > > rencontré une erreur interne () qui l'a empêché de satisfaire la
> > > > requête.exceptionjavax.servlet.ServletException:
> > > > org.apache.jasper.JasperException: javax.servlet.ServletException:
> > > > javax.servlet.jsp.JspException: No getter method for property: "id" of
> > > > bean: "test"
> > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
> > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > >
> >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > cause mèreorg.apache.jasper.JasperException:
> > > > javax.servlet.ServletException: javax.servlet.jsp.JspException: No
> > getter
> > > > method for property: "id" of bean: "test"
> > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
> > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
> > > >
> > > >
> >  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
> > > >
> >  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
> > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
> > > >
> > > >
> >  org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
> > > >
> > > >
> >  org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
> > > >
> >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > >
> > > >
> >  org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
> > > >
> >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
> > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > >
> >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > cause mèrejavax.servlet.ServletException:
> > javax.servlet.jsp.JspException:
> > > > No getter method for property: "id" of bean: "test"
> > > >
> > > >
> >  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
> > > >
> > > >
> >  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
> > > >        org.apache.jsp.list_jsp._jspService(list_jsp.java:141)
> > > >
> >  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
> > > >
> > > >
> >  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
> > > >
> >  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
> > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
> > > >
> > > >
> >  org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
> > > >
> > > >
> >  org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
> > > >
> >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > >
> > > >
> >  org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
> > > >
> >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
> > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > >
> >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > cause mèrejavax.servlet.jsp.JspException: No getter method for
> > property:
> > > > "id" of bean: "test"
> > > >        org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:915)
> > > >
> >  org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:233)
> > > >
> > > >
> >  org.apache.jsp.list_jsp._jspx_meth_bean_005fwrite_005f0(list_jsp.java:160)
> > > >        org.apache.jsp.list_jsp._jspService(list_jsp.java:104)
> > > >
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
> > > >
> > > >
> >  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
> > > >
> >  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
> > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
> > > >
> > > >
> >  org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
> > > >
> > > >
> >  org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
> > > >
> >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > >
> > > >
> >  org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
> > > >
> >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
> > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > >
> >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > note La trace complète de la cause mère de cette erreur est disponible
> > > > dans les fichiers journaux de Apache Tomcat/6.0.35.Apache Tomcat/6.0.35
> > > > > Date: Sat, 17 Mar 2012 17:45:24 -0400
> > > > > Subject: Re: Cannot find bean: “list” in any scope
> > > > > From: davelnewton@gmail.com
> > > > > To: user@struts.apache.org
> > > > >
> > > > > The line that puts it in the request is commented out, is that a
> > typo?
> > > > >
> > > > > (pardon brevity and typos, on cell)
> > > > > On Mar 17, 2012 5:43 PM, "Oussama Jlassi" <oussamaj@live.fr>
wrote:
> > > > >
> > > > > >
> > > > > > i want to list table test with hibernate4 and struts1.3.10 in
> > tomcat6
> > > > but
> > > > > > when i run localhost:8080/strutsh/hib1.do i get
> > > > > >
> > > > > > Etat HTTP 500 -type Rapport d'exceptionmessagedescription Le
> > serveur a
> > > > > > rencontré une erreur interne () qui l'a empêché de satisfaire
la
> > > > > > requête.exceptionjavax.servlet.ServletException:
> > > > > > org.apache.jasper.JasperException: javax.servlet.ServletException:
> > > > > > javax.servlet.jsp.JspException: Cannot find bean: "list" in
any
> > scope
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > > > >
> > > >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > > cause mèreorg.apache.jasper.JasperException:
> > > > > > javax.servlet.ServletException: javax.servlet.jsp.JspException:
> > Cannot
> > > > find
> > > > > > bean: "list" in any scope
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
> > > > > >
> > > >  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
> > > > > >
> > > >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > > > >
> > > > > >
> > > >
> >  org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
> > > > > >
> > > >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > > > >
> > > >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > > cause mèrejavax.servlet.ServletException:
> > > > javax.servlet.jsp.JspException:
> > > > > > Cannot find bean: "list" in any scope
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
> > > > > >        org.apache.jsp.list_jsp._jspService(list_jsp.java:141)
> > > > > >
> > > >  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
> > > > > >
> > > >  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
> > > > > >
> > > >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > > > >
> > > > > >
> > > >
> >  org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
> > > > > >
> > > >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > > > >
> > > >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > > cause mèrejavax.servlet.jsp.JspException: Cannot find bean:
"list"
> > in
> > > > any
> > > > > > scope
> > > > > >        org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:864)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:236)
> > > > > >        org.apache.jsp.list_jsp._jspService(list_jsp.java:92)
> > > > > >
> > > >  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
> > > > > >
> > > > > >
> > > >
> >  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
> > > > > >
> > > >  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
> > > > > >
> > > >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > > > >
> > > > > >
> > > >
> >  org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
> > > > > >
> > > >  org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
> > > > > >
> > > > > >
> > > >
> >  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> > > > > >
> > > >  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> > > > > >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> > > > > > note La trace complète de la cause mère de cette erreur est
> > disponible
> > > > > > dans les fichiers journaux de Apache Tomcat/6.0.35.Apache
> > Tomcat/6.0.35
> > > > > > list.jsp
> > > > > >
> > > > > > <%@ page language="java" pageEncoding="ISO-8859-1"%><%@
taglib
> > uri="
> > > > > > http://struts.apache.org/tags-html" prefix="html" %><%@
taglib
> > uri="
> > > > > > http://struts.apache.org/tags-logic" prefix="logic" %><%@
taglib
> > uri="
> > > > > > http://struts.apache.org/tags-bean" prefix="bean" %>
> > > > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > > > > > <html:html>    <head>        <meta http-equiv="Content-Type"
> > > > > > content="text/html; charset=UTF-8">        <title>JSP
Page</title>
> > > > > >  </head>    <body>
> > > > > > <logic:iterate name="list" id="test"><p><bean:write
name="test"
> > > > > > property="id"/></p></logic:iterate>    </body></html:html>
> > > > > >
> > > > > >
> > > > > > Hib1Action
> > > > > >
> > > > > > import javax.servlet.http.HttpServletRequest;import
> > > > > > javax.servlet.http.HttpServletResponse;import
> > > > javax.servlet.ServletContext;
> > > > > > 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.hibernate.*;
> > > > > > import java.util.*;
> > > > > > public class Hib1Action extends Action {
> > > > > > private List<test> list = new ArrayList<test>();
> > > > > > @SuppressWarnings("unchecked")
> > > > > >        public ActionForward execute(           ActionMapping
> > mapping,
> > > > > >      ActionForm form,                HttpServletRequest request,
> > > > > >   HttpServletResponse response) throws Exception{
> > > > > >                ServletContext context =
> > > > > > request.getSession().getServletContext();
> > > > > >                SessionFactory factory = (SessionFactory)
> > > > > >  context.getAttribute(HibernatePlugIn.SESSION_FACTORY_KEY);
> > > > > >                Session session = factory.openSession();try {
> > > > > >     //session.beginTransaction();
> > > > > > list= session.createSQLQuery("SELECT * FROM test").list();
> > > > > >                  //session.getTransaction().commit();
> > > > > >  //request.setAttribute("list",list);
> > > > > >  } catch(Exception e) {
> > > > > >  session.getTransaction().rollback();
> > > >  e.printStackTrace(); }
> > > > > >                       session.flush();
> >  session.close();
> > > > > >                return mapping.findForward("success");  }
> > > > > > public List<test> getList() {           return list; 
  }
> > > > > > public void setList(List<test> list) {          this.list
= list;
> > > >   } }
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message