RicardoPereira
Programmer
Hi,
I can't make my jsp page display the results posted in a form. I have tree files:
1-form.jsp
2-form_resp.jsp
3-database.java
form.jsp
------
...
<form method="POST" action="pesquisa_encomenda_qry.jsp">
<table border="0" cellpadding="4" cellspacing="2" align="center">
<center><font class="bolddark">Pesquisas IOL <br>:or Nº de Encomenda::<br></font><br></center>
<hr>
<tr>
<td class="bolddark">Nº Encomenda:</td>
<td><input type="text" name="XNENC" class="formstyleShort"</td>
</table>
</table>
...
form_resp.jsp
---------------
...
<jsp:useBean id="pesquisas" scope="request" class="bd.AcessoBD" />
<%
ArrayList listaEnc=pesquisas.getNEncomenda();
for( int x=0;x<listaEnc.size();x++) {
xiol01p xiol=(xiol01p) listaEnc.get(x);
out.println("<TR><TD width='50%' align='center' bgcolor='#CCCCCC'><font face='Arial' size='3'>" + xiol.getXCVND() +
xiol.getXNENC()+ xiol.getXNACT() + xiol.getXNGT()"</a></TD></TR>"
}
%>
...
database.java
-------------
connection ...
...
public ArrayList getNEncomenda(String XNENC) throws SQLException {
ArrayList res=new ArrayList();
PreparedStatement pstmt=
con.prepareStatement("select XCVND, XNENC, XDEXP, XNACT, XNGT " +
"from XIOL01P " +
"where XNENC=? " +
"Order By XNENC "
ResultSet rslt=pstmt.executeQuery();
while (rslt.next()) {
res.add(new entidades.xiol01p (rslt.getString(1),rslt.getString(2),rslt.getInt(3), rslt.getString(4), rslt.getString(5)) );
}
return res;
}
...
My problem is that i'am having always the same message
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:153: ')' expected
[javac] xiol.getXNENC()+ xiol.getXNACT() + xiol.getXNGT()""
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:149: cannot resolve symbol
[javac] symbol : class ArrayList
[javac] location: class org.apache.jsp.pesquisa_encomenda_qry_jsp
[javac] ArrayList listaEnc=pesquisas.getNEncomenda();
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:149: getNEncomenda(java.lang.String) in bd.AcessoBD cannot be applied to ()
[javac] ArrayList listaEnc=pesquisas.getNEncomenda();
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:151: cannot resolve symbol
[javac] symbol : class xiol01p
[javac] location: class org.apache.jsp.pesquisa_encomenda_qry_jsp
[javac] xiol01p xiol=(xiol01p) listaEnc.get(x);
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:151: cannot resolve symbol
[javac] symbol : class xiol01p
[javac] location: class org.apache.jsp.pesquisa_encomenda_qry_jsp
[javac] xiol01p xiol=(xiol01p) listaEnc.get(x);
[javac] ^
[javac] 5 errors
What should i do to resolve this???
Thanks
I can't make my jsp page display the results posted in a form. I have tree files:
1-form.jsp
2-form_resp.jsp
3-database.java
form.jsp
------
...
<form method="POST" action="pesquisa_encomenda_qry.jsp">
<table border="0" cellpadding="4" cellspacing="2" align="center">
<center><font class="bolddark">Pesquisas IOL <br>:or Nº de Encomenda::<br></font><br></center>
<hr>
<tr>
<td class="bolddark">Nº Encomenda:</td>
<td><input type="text" name="XNENC" class="formstyleShort"</td>
</table>
</table>
...
form_resp.jsp
---------------
...
<jsp:useBean id="pesquisas" scope="request" class="bd.AcessoBD" />
<%
ArrayList listaEnc=pesquisas.getNEncomenda();
for( int x=0;x<listaEnc.size();x++) {
xiol01p xiol=(xiol01p) listaEnc.get(x);
out.println("<TR><TD width='50%' align='center' bgcolor='#CCCCCC'><font face='Arial' size='3'>" + xiol.getXCVND() +
xiol.getXNENC()+ xiol.getXNACT() + xiol.getXNGT()"</a></TD></TR>"
}
%>
...
database.java
-------------
connection ...
...
public ArrayList getNEncomenda(String XNENC) throws SQLException {
ArrayList res=new ArrayList();
PreparedStatement pstmt=
con.prepareStatement("select XCVND, XNENC, XDEXP, XNACT, XNGT " +
"from XIOL01P " +
"where XNENC=? " +
"Order By XNENC "
ResultSet rslt=pstmt.executeQuery();
while (rslt.next()) {
res.add(new entidades.xiol01p (rslt.getString(1),rslt.getString(2),rslt.getInt(3), rslt.getString(4), rslt.getString(5)) );
}
return res;
}
...
My problem is that i'am having always the same message
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:153: ')' expected
[javac] xiol.getXNENC()+ xiol.getXNACT() + xiol.getXNGT()""
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:149: cannot resolve symbol
[javac] symbol : class ArrayList
[javac] location: class org.apache.jsp.pesquisa_encomenda_qry_jsp
[javac] ArrayList listaEnc=pesquisas.getNEncomenda();
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:149: getNEncomenda(java.lang.String) in bd.AcessoBD cannot be applied to ()
[javac] ArrayList listaEnc=pesquisas.getNEncomenda();
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:151: cannot resolve symbol
[javac] symbol : class xiol01p
[javac] location: class org.apache.jsp.pesquisa_encomenda_qry_jsp
[javac] xiol01p xiol=(xiol01p) listaEnc.get(x);
[javac] ^
[javac] C:\tomcat\webserver\work\Standalone\localhost\_\IOL\users\Pesquisas\pesquisa_encomenda_qry_jsp.java:151: cannot resolve symbol
[javac] symbol : class xiol01p
[javac] location: class org.apache.jsp.pesquisa_encomenda_qry_jsp
[javac] xiol01p xiol=(xiol01p) listaEnc.get(x);
[javac] ^
[javac] 5 errors
What should i do to resolve this???
Thanks