Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error on ArrayList

Status
Not open for further replies.

RicardoPereira

Programmer
Jun 3, 2003
255
PT
I'am trying to display all the records from a table to my jsp page without requesting parameters (without forms), but i'am getting always the same erros message.


org.apache.jasper.JasperException: ControloBD.ControloQualidadeBD.getTblErros()Ljava/util/ArrayList;
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


...







I have an jsp file with a bean that access a class file.

Jsp file:
---------


<%@page contentType=&quot;text/html&quot; import=&quot;java.util.ArrayList, entidades.*&quot; %>
<jsp:useBean id=&quot;pesquisas&quot; scope=&quot;request&quot; class=&quot;ControloBD.ControloQualidadeBD&quot; />
<HR><center><table border=0 cellspacing=1 cellpadding=2 bgcolor = &quot;#eeeeee&quot;>
<tr bgcolor=&quot;#eeeeee&quot;><td class=&quot;smallerheader&quot;><font class=&quot;smallerheader&quot;>
<b>Código Erro</b></font></td><td class=&quot;smallerheader&quot;><font class=&quot;smallerheader&quot;><font class=&quot;smallerheader&quot;>
<b>Descrição Erro</b></font></td></tr>

<%
ArrayList listaTErro=pesquisas.getTblErros();
for( int x=0;x<listaTErro.size();x++)
{
Tbl_Erros TErro=(Tbl_Erros) listaTErro.get(x);
out.println(&quot;<tr bgcolor='#ffffff'>&quot; +
&quot;<td><p align='center'>&quot; + TErro.getQ3CODERRO() +
&quot;</p></td><td class='smallertext'><font color='#9b301c'><b><p align='center'>&quot; + TErro.getQ3DESCERRO() + &quot;</p></b></td></tr>&quot;);
}
%>
</table></center><HR>


Method getTblErros in class ControloQualidadeBD
-----------------------------------------------

public ArrayList getTblErros() throws SQLException {
ArrayList res=new ArrayList();

Statement stmt = con.createStatement();
ResultSet rslt = stmt.executeQuery(&quot;select Q3CODERRO, Q3DESCERRO from Tbl_Erros&quot;);

while (rslt.next()) {
res.add(new Tbl_Erros(rslt.getString(1), rslt.getString(2)));
}

return res;
}



class Tbl_Erros
---------------


package entidades;


public class Tbl_Erros {

String Q3CODERRO;
String Q3DESCERRO;

public Tbl_Erros() {
}

public Tbl_Erros(String Q3CODERRO, String Q3DESCERRO) {

this.Q3CODERRO=Q3CODERRO;
this.Q3DESCERRO=Q3DESCERRO;

}

public String getQ3CODERRO() {
return Q3CODERRO;
}

public String getQ3DESCERRO() {
return Q3DESCERRO;
}
}


----------------------------------------------------


What should be the cause of this error?

Thanks
Ricardo Pereira
 
>> i'am getting always the same erros message.
>> What should be the cause of this error?

yeah... maybe if you posted the error message we might have a clue.

Also post the line of code producing the error.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top