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 16:10:39 GMT


Hey all,

Could anyone help me, please?. I have the next mistake and I'm trying to fix it but I don't
achieve it. This is the mistake:

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)


And these are the source which I use for doing it:

web_adminContent.jsp













Users Management page :





Passport
Users Name
Country



">













Web_AdminAction.java :

//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.1/xslt/JavaClass.xsl

package 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.java

public 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?. Where is my mistake. Thanks so much for all

Carlos
_________________________________________________________________
Sigue en directo todas las competiciones deportivas en MSN Deportes
http://deportes.es.msn.com/
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message