tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Morales Diego <calvin2...@hotmail.com>
Subject org.apache.jasper.JasperException: Cannot find bean usersList in scope request
Date Sat, 12 Jul 2008 13:33:16 GMT

 Hello everyone,
 
I have the next problem with my JSP files. I have the next mistake and I don't know how to
fix it:
 
excepción org.apache.jasper.JasperException: Cannot find bean usersList in scope request
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


causa raíz javax.servlet.ServletException: Cannot find bean usersList in scope request
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
	org.apache.jsp.web_005fadminContent_jsp._jspService(web_005fadminContent_jsp.java:150)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


causa raíz javax.servlet.jsp.JspException: Cannot find bean usersList in scope request
	org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:940)
	org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:277)
	org.apache.jsp.web_005fadminContent_jsp._jspService(web_005fadminContent_jsp.java:98)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802) These are the sources:indexContent.jsp<%@
taglib uri="/bean" prefix="bean" %><%@ taglib uri="/html" prefix="html" %><%@
taglib uri="/logic" prefix="logic" %><%@ taglib uri="/template" prefix="template" %>
 <br/><br/><html:errors/><center><h2>Users Management page :</h2></center><center><table
width="70%"><tr><th width="25%" bgcolor=#c7c1c0>Passport</th><th width="30%"
bgcolor=#F27600>Users Name</th><th width="25%" bgcolor=#c7c1c0>Country</th></tr><logic:iterate
id="users" name="usersList" scope="request" type="com.genausal.entity.Users"><tr><a
href="consultuseradmin.do?passport_id"=<bean:write name="users" property="passport_id"/>"><bean:write
name="users" property="passport_id"/></a></tr><tr><bean:write name="users"
property="first_name"/></tr><tr><bean:write name="users" property="country"/></tr></logic:iterate></table></center>Web_AdminAction.java://Created
by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.1/xslt/JavaClass.xslpackage
com.genausal.actions;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import
javax.servlet.ServletException;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.action.ActionErrors;import org.apache.struts.action.ActionError;import org.apache.struts.action.ActionServlet;import
java.io.IOException;import java.sql.Connection;import java.sql.SQLException;import java.util.Collection;import
com.genausal.databases.util.ConnectionPool;import com.genausal.databases.UsersDAO;import com.genausal.entity.Users;/**
 * MyEclipse Struts * Creation date: 06-26-2008 *  * XDoclet definition: * @struts.action
validate="true" * @struts.action-forward name="success" path="/web_admin.jsp" */public class
Web_AdminAction extends Action { // ---------------------------------------------------------
Instance Variables       private ConnectionPool pool; // ---------------------------------------------------------
Methods /**   * Method execute  * @param mapping  * @param form  * @param request  * @param
response  * @return ActionForward  */          public Web_AdminAction(){      pool=ConnectionPool.getInstance();
    }               public ActionForward perform(  ActionMapping mapping,  ActionForm form,
 HttpServletRequest request,  HttpServletResponse response)throws IOException,ServletException
{  Connection con=null;  try{   con=pool.getConnection();   UsersDAO usersDAO=new UsersDAO(con);
  Collection col=usersDAO.findAll();      request.setAttribute(BeanNames.USER_LIST,col); 
   return  mapping.findForward("success");  }catch (SQLException e){   e.printStackTrace();
  throw new RuntimeException("It's impossible to get the connection");  }finally{   try{ 
  if(con!=null)     con.close();   }catch(SQLException e){    throw new RuntimeException(e.getMessage());
  }  }   }}UsersDAO.javapublic Collection findAll(){      PreparedStatement ps=null;   ResultSet
rs=null;   ArrayList list=new ArrayList();      String sql="SELECT * from users";      try{
   if(con.isClosed()){     throw new IllegalStateException("error.unexpected");    }     
  ps=con.prepareStatement(sql);    rs=ps.executeQuery();        while(rs.next()){     Users
users=new Users();     users.setpassport_id(rs.getString(1));     users.setlast_name(rs.getString(2));
    users.setfirst_name(rs.getString(3));     users.setaddress(rs.getString(4));     users.setphone(rs.getString(5));
    users.setcountry(rs.getString(6));     users.setcity(rs.getString(7));     users.setstate(rs.getString(8));
    users.setcategory(rs.getString(9));     users.setmail(rs.getString(10));     users.setc_mail(rs.getString(11));
    users.setpassword(rs.getString(12));               list.add(users);         }    return
list;   }catch(SQLException e){    e.printStackTrace();    throw new RuntimeException("error.unexpected");
  }finally{    try{     if(ps!=null)      ps.close();     if(rs!=null)      rs.close();  
 }catch(SQLException e){     e.printStackTrace();     throw new RuntimeException("error.unexpected");
   }   }  }
Could anyone help me, please?, It's very important for me.Thanks so much from SpainCarlos
_________________________________________________________________
Hazte tu propia televisión a la carta. Música, noticias, estrenos, cine, humor y viajes
en MSN Vídeo
http://video.msn.com/?mkt=es-es
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message