ermasto
12-07-2005, 15:25
ragazzi sto provando a far girare la mia pagina jsp su tomcat solo che mi da sempre questo errore :
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
Only a type can be imported. java.util.Proprietes resolves to a package
An error occurred at line: 94 in the jsp file: /hermann/home2.jsp
Generated servlet error:
st cannot be resolved
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
penso che sia relativo ai package che non importo correttamente infatti l'errore si riferisce alla prima riga. La mia pagina jsp è la seguente:
<html>
<head>
<title>LEFRAHER</title>
</head>
<LINK href="style.css" rel=stylesheet>
<script language=javascript>
var popup=null;
function pop_open() {
popup = window.open('wait.html','aspetta','width=500,height=100');
}
function pop_close() {
if (popup!=null) {
setTimeout('',2000);
popup.close();
}
}
//Le funzioni pop_open e pop_close servono per aprire
//e chiudere la finestra di pop up di attesa connessione
</script>
<%String login=new String();
String passwd=new String();
String logout=new String();
int cliente=0;
int relogin=1;
//la variabile "percorso" viene incrementata ad ogni pagina.
//serve per controllare che l'utente rispetti l'ordine di
//apertura delle pagine.
session.setAttribute("percorso","0");
try{
login=request.getParameter("login");
passwd=request.getParameter("passwd");
logout=request.getParameter("logout");
}catch(Exception e){%>
<%=e%><%}
//La variabile "logout" serve per conoscere lo stato della sessione.
//Se contiene un valore significa che un utente registrato
//vuole rimuovere la login fatta in precedenza e immetterne un'altra
//o semplicemente eliminare lo sato corrente di utente registrato.
if(logout!=null) if(logout.length()!=0){
session.removeAttribute("login");
session.removeAttribute("passwd");
}
String coologin=(String) session.getAttribute("login");
String coopasswd=(String) session.getAttribute("passwd");
//Verifica se la session contiene login e password
if((coologin!=null) && (coopasswd!=null)){
login=coologin;
passwd=coopasswd;
}
if((login!=null) && (passwd!=null)) {
if((login.length()==0)&&(passwd.length()==0)){
cliente=0;
session.setAttribute("loginaccettata","0");
}else{
cliente=1;
}
}else{
cliente=0;
session.setAttribute("loginaccettata","0");
}
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
final String DB_URL = "jdbc:odbc:database"; //database è il nome del db
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(java.lang.ClassNotFoundException e)
{
System.out.println("Error");
}
conn = DriverManager.getConnection(DB_URL, "User", "PWD");
stmt = conn.createStatement();
try
{
// richiesta di connessione - ritorna una istanza di connessione
conn = DriverManager.getConnection(DB_URL, "User", "PWD");
// statement per inviare i comandi al database
stmt = conn.createStatement();
}
catch(SQLException ex)
{
System.out.println(" Error.");
%> <%
return;}
if(cliente==1){
//Verifica se login e password sono corrette
rs=st.executeQuery("select count(*) as verifica from cliente where login='"+login+"' and password='"+passwd+"';");
while(rs.next()){
if(rs.getInt("verifica")<1) {cliente=0; relogin=0;session.setAttribute("loginaccettata","0");
}else{
session.setAttribute("loginaccettata","1");
session.setAttribute("login",login);
session.setAttribute("passwd",passwd);
}
}
}
%>
<body leftmargin=0 topmargin=0 onUnload=pop_close()>
<TABLE WIDTH=867 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="1053">
<TR>
<TD colspan="2">
<IMG SRC="immagini/background_01.jpg" WIDTH=179 HEIGHT=158></TD>
<TD colspan="2">
<p align="center">BENVENUTI SU LEFRAHER</p>
<p align="center">SITO DEDICATO ALLA VENDITA DI CD-DVD-LIBRI</TD>
<TD width="17"> </TD>
<% if(cliente==0){%>
<td width="235">
<CENTER><h3>LOGIN</H3>
<FORM action="index.jsp" method=Post>
<table border=0>
<tr>
<td>User</TD><td><INPUT type=text name=login size=10></td>
</tr><tr>
<td>Password</TD><td><INPUT type=password name=passwd size=10></td>
</tr>
<TR><td><input type=reset value='Cancella'></td><TD><input type=submit value='Conferma'></TD></TR>
</TABLE>
</FORM>
<input type=submit value='Cambia Cliente'><p>Per Registrarti
clicca qui: <a href="Registrazione.htm">Registra! </a>
</p>
</CENTER>
</td>
<%}else{%>
<%}%>
</TR>
<TR>
<TD height="288" width="196">
SEZIONI PRESENTI:<p> </p>
<form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
<!--webbot bot="SaveResults" U-File="_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" i-checksum="43374" endspan -->
<p><img border="0" src="images/cd.gif" width="60" height="45">
<input type="button" value="CD" name="B3"></p>
</form>
<form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
<!--webbot bot="SaveResults" U-File="_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="1"><!--webbot bot="SaveResults" i-checksum="43406" endspan -->
<p><img border="0" src="images/DVD.gif" width="60" height="57">
<input type="button" value="DVD" name="B6"></p>
</form>
<p><img border="0" src="images/libri.gif" width="55" height="60">
<input type="button" value="LIBRI" name="B4"></TD>
<TD height="288" width="6">
</TD>
<TD valign=top align=center height="288" width="409"><br>
<hr>OFFERTA SPECIALE!!!<p>CD</p>
<p><img border="0" src="images/Bob.jpg" width="70" height="95"></p>
<p><b>Legend: The Very Best Of (2CD)</b><br>
di BOB MARLEY<br>
UNIVERSAL MUSIC - Supporto: CD<br>
Serie Sound+Vision Deluxe Edition Boxset<br>
<span class="wn_prezzo">28,99 €</span>
<a class="autore_scheda" href="http://www.topten.it/index.php?sez=CD&sub=scheda&id=34664">
Vai alla scheda</a> <a class="wn_prezzo" href="http://www.topten.it/index.php?sez=USR&sub=carrello&azione=aggiungi&id=34664&q=1">BUY</a>
</p>
<p> </p>
<p>DVD</p>
<p><img border="0" src="images/helsing.jpg" width="72" height="103"></p>
<p><span class="titolo_scheda">VAN HELSING (2DVD SPECIAL)</span><span class="verd_1"><br>
<b>Regia:</b>
<a class="verd_1" href="http://www.topten.it/index.php?sez=DVD&sub=quicksearch&campo=Regia&args=Stephen+Summers">
Stephen Summers</a><br>
<b>Anno di emissione:</b> 2005<br>
<b>Produttore:</b> UNIVERSAL PICTURES ITALY Srl<br>
<span class="prezzi_scheda">14,99 € <a class="prezzi_scheda" href="http://www.topten.it/index.php?sez=USR&sub=carrello&azione=aggiungi&id=39914&q=1">BUY</a></span></span>
</p>
<p> </p>
<p>LIBRI</p>
<p>
<img border="0" src="images/piu_felici_in_amore_red.jpg" width="71" height="110"></p>
<p>
<b>Più Felici in Amore</b><br>
di <span style="font-weight: 400; letter-spacing: -1pt"><font size="3">
Claude-Marc Aubry </font></span><br>
<span style="font-weight: 400; letter-spacing: -1pt"><font size="3">Come
costruire una relazione piena e gioiosa giorno per giorno</font></span><br>
<span class="wn_prezzo">13.00€</span>
<a class="autore_scheda" href="http://www.topten.it/index.php?sez=CD&sub=scheda&id=34664">
Vai alla scheda</a> <a class="wn_prezzo" href="http://www.topten.it/index.php?sez=USR&sub=carrello&azione=aggiungi&id=34664&q=1">BUY</a>
</p>
<p> </p>
<p> </td>
<TD valign=top align=center height="288" width="4"> </td>
</TR>
<TR>
<TD width="196">
</TD>
<TD width="6">
</TD>
<TD valign=top align=center width="409"> </td>
<TD valign=top align=center width="4"> </td>
</TR>
</TABLE>
</body>
</html>
Chi gentilmente mi dice cosa modificare della mia pagina affinche venga compilata?? :mc:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
Only a type can be imported. java.util.Proprietes resolves to a package
An error occurred at line: 94 in the jsp file: /hermann/home2.jsp
Generated servlet error:
st cannot be resolved
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
penso che sia relativo ai package che non importo correttamente infatti l'errore si riferisce alla prima riga. La mia pagina jsp è la seguente:
<html>
<head>
<title>LEFRAHER</title>
</head>
<LINK href="style.css" rel=stylesheet>
<script language=javascript>
var popup=null;
function pop_open() {
popup = window.open('wait.html','aspetta','width=500,height=100');
}
function pop_close() {
if (popup!=null) {
setTimeout('',2000);
popup.close();
}
}
//Le funzioni pop_open e pop_close servono per aprire
//e chiudere la finestra di pop up di attesa connessione
</script>
<%String login=new String();
String passwd=new String();
String logout=new String();
int cliente=0;
int relogin=1;
//la variabile "percorso" viene incrementata ad ogni pagina.
//serve per controllare che l'utente rispetti l'ordine di
//apertura delle pagine.
session.setAttribute("percorso","0");
try{
login=request.getParameter("login");
passwd=request.getParameter("passwd");
logout=request.getParameter("logout");
}catch(Exception e){%>
<%=e%><%}
//La variabile "logout" serve per conoscere lo stato della sessione.
//Se contiene un valore significa che un utente registrato
//vuole rimuovere la login fatta in precedenza e immetterne un'altra
//o semplicemente eliminare lo sato corrente di utente registrato.
if(logout!=null) if(logout.length()!=0){
session.removeAttribute("login");
session.removeAttribute("passwd");
}
String coologin=(String) session.getAttribute("login");
String coopasswd=(String) session.getAttribute("passwd");
//Verifica se la session contiene login e password
if((coologin!=null) && (coopasswd!=null)){
login=coologin;
passwd=coopasswd;
}
if((login!=null) && (passwd!=null)) {
if((login.length()==0)&&(passwd.length()==0)){
cliente=0;
session.setAttribute("loginaccettata","0");
}else{
cliente=1;
}
}else{
cliente=0;
session.setAttribute("loginaccettata","0");
}
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
final String DB_URL = "jdbc:odbc:database"; //database è il nome del db
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(java.lang.ClassNotFoundException e)
{
System.out.println("Error");
}
conn = DriverManager.getConnection(DB_URL, "User", "PWD");
stmt = conn.createStatement();
try
{
// richiesta di connessione - ritorna una istanza di connessione
conn = DriverManager.getConnection(DB_URL, "User", "PWD");
// statement per inviare i comandi al database
stmt = conn.createStatement();
}
catch(SQLException ex)
{
System.out.println(" Error.");
%> <%
return;}
if(cliente==1){
//Verifica se login e password sono corrette
rs=st.executeQuery("select count(*) as verifica from cliente where login='"+login+"' and password='"+passwd+"';");
while(rs.next()){
if(rs.getInt("verifica")<1) {cliente=0; relogin=0;session.setAttribute("loginaccettata","0");
}else{
session.setAttribute("loginaccettata","1");
session.setAttribute("login",login);
session.setAttribute("passwd",passwd);
}
}
}
%>
<body leftmargin=0 topmargin=0 onUnload=pop_close()>
<TABLE WIDTH=867 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="1053">
<TR>
<TD colspan="2">
<IMG SRC="immagini/background_01.jpg" WIDTH=179 HEIGHT=158></TD>
<TD colspan="2">
<p align="center">BENVENUTI SU LEFRAHER</p>
<p align="center">SITO DEDICATO ALLA VENDITA DI CD-DVD-LIBRI</TD>
<TD width="17"> </TD>
<% if(cliente==0){%>
<td width="235">
<CENTER><h3>LOGIN</H3>
<FORM action="index.jsp" method=Post>
<table border=0>
<tr>
<td>User</TD><td><INPUT type=text name=login size=10></td>
</tr><tr>
<td>Password</TD><td><INPUT type=password name=passwd size=10></td>
</tr>
<TR><td><input type=reset value='Cancella'></td><TD><input type=submit value='Conferma'></TD></TR>
</TABLE>
</FORM>
<input type=submit value='Cambia Cliente'><p>Per Registrarti
clicca qui: <a href="Registrazione.htm">Registra! </a>
</p>
</CENTER>
</td>
<%}else{%>
<%}%>
</TR>
<TR>
<TD height="288" width="196">
SEZIONI PRESENTI:<p> </p>
<form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
<!--webbot bot="SaveResults" U-File="_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" i-checksum="43374" endspan -->
<p><img border="0" src="images/cd.gif" width="60" height="45">
<input type="button" value="CD" name="B3"></p>
</form>
<form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
<!--webbot bot="SaveResults" U-File="_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="1"><!--webbot bot="SaveResults" i-checksum="43406" endspan -->
<p><img border="0" src="images/DVD.gif" width="60" height="57">
<input type="button" value="DVD" name="B6"></p>
</form>
<p><img border="0" src="images/libri.gif" width="55" height="60">
<input type="button" value="LIBRI" name="B4"></TD>
<TD height="288" width="6">
</TD>
<TD valign=top align=center height="288" width="409"><br>
<hr>OFFERTA SPECIALE!!!<p>CD</p>
<p><img border="0" src="images/Bob.jpg" width="70" height="95"></p>
<p><b>Legend: The Very Best Of (2CD)</b><br>
di BOB MARLEY<br>
UNIVERSAL MUSIC - Supporto: CD<br>
Serie Sound+Vision Deluxe Edition Boxset<br>
<span class="wn_prezzo">28,99 €</span>
<a class="autore_scheda" href="http://www.topten.it/index.php?sez=CD&sub=scheda&id=34664">
Vai alla scheda</a> <a class="wn_prezzo" href="http://www.topten.it/index.php?sez=USR&sub=carrello&azione=aggiungi&id=34664&q=1">BUY</a>
</p>
<p> </p>
<p>DVD</p>
<p><img border="0" src="images/helsing.jpg" width="72" height="103"></p>
<p><span class="titolo_scheda">VAN HELSING (2DVD SPECIAL)</span><span class="verd_1"><br>
<b>Regia:</b>
<a class="verd_1" href="http://www.topten.it/index.php?sez=DVD&sub=quicksearch&campo=Regia&args=Stephen+Summers">
Stephen Summers</a><br>
<b>Anno di emissione:</b> 2005<br>
<b>Produttore:</b> UNIVERSAL PICTURES ITALY Srl<br>
<span class="prezzi_scheda">14,99 € <a class="prezzi_scheda" href="http://www.topten.it/index.php?sez=USR&sub=carrello&azione=aggiungi&id=39914&q=1">BUY</a></span></span>
</p>
<p> </p>
<p>LIBRI</p>
<p>
<img border="0" src="images/piu_felici_in_amore_red.jpg" width="71" height="110"></p>
<p>
<b>Più Felici in Amore</b><br>
di <span style="font-weight: 400; letter-spacing: -1pt"><font size="3">
Claude-Marc Aubry </font></span><br>
<span style="font-weight: 400; letter-spacing: -1pt"><font size="3">Come
costruire una relazione piena e gioiosa giorno per giorno</font></span><br>
<span class="wn_prezzo">13.00€</span>
<a class="autore_scheda" href="http://www.topten.it/index.php?sez=CD&sub=scheda&id=34664">
Vai alla scheda</a> <a class="wn_prezzo" href="http://www.topten.it/index.php?sez=USR&sub=carrello&azione=aggiungi&id=34664&q=1">BUY</a>
</p>
<p> </p>
<p> </td>
<TD valign=top align=center height="288" width="4"> </td>
</TR>
<TR>
<TD width="196">
</TD>
<TD width="6">
</TD>
<TD valign=top align=center width="409"> </td>
<TD valign=top align=center width="4"> </td>
</TR>
</TABLE>
</body>
</html>
Chi gentilmente mi dice cosa modificare della mia pagina affinche venga compilata?? :mc: