PDA

Visualizza la versione completa : [JAVA] StringTokenizer


vgiani
13-12-2002, 09:39
Ciao a tutti, il mio problema QUESTO:
in una parte del programma definisco :

StringTokenizer t;
StringTokenizer w;
StringTokenizer a;
StringTokenizer f;

poi :
t = new StringTokenizer( fields, "," );
w = new StringTokenizer( widthx, "," );
a = new StringTokenizer( alignx, "," );
f = new StringTokenizer( fontcolorx, "," );

e dopo li uso per scrivere una tabella:
while((t.hasMoreTokens())||(w.hasMoreTokens())||(a .hasMoreTokens())||(f.hasMoreTokens()))
{
pageContext.getOut().println( "<td width='"+rs.getString (w.nextToken())+"' align='"+rs.getString( a.nextToken())+"'>" );
pageContext.getOut().println( "<font color='"+rs.getString( f.nextToken())+"'>"+rs.getString( t.nextToken())+"</font>");
pageContext.getOut().println( "</td>" );
}

/* close the line (7)*/
pageContext.getOut().println( "</tr>" );

ma quando uso w.nexrToken mi da errore:
javax.servlet.ServletException: query:Column not found

Come mai?
i campi sono valorizzati cos:
fields="PVIND01_AREA,PVIND01_CODICE,PVIND01_DESCRIZIONE"
widthx="54,68,858"
alignx="left,center,right"
fontcolorx="red,blue,yellow"

floyd
13-12-2002, 09:51
prova a postare tutto lo stack trace

vgiani
13-12-2002, 09:52
cosa? non ho capito cosa devo postare

floyd
13-12-2002, 09:56
eh :master: tutto il trace dell'errore o eccezione

vgiani
13-12-2002, 10:02
eccolo:
type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: query:Column not found
at org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:463)
at org.apache.jsp.query$jsp._jspService(query$jsp.jav a:94)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.p rocess(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.r un(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)


root cause

javax.servlet.jsp.JspException: query:Column not found
at com.nos.tag.query.doStartTag(query.java:100)
at org.apache.jsp.query$jsp._jspService(query$jsp.jav a:71)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.p rocess(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.r un(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)



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

floyd
13-12-2002, 10:11
direi che non scatenato dal nextToken ma dalla pagina query.jsp, il trace dice la riga dell'errore nel java e non nella jsp di origine

vgiani
13-12-2002, 10:14
usando forte della sun e facendo debug mi si blocca e da un'eccezione nel momento in cui uso
rs.getString (w.nextToken())
quindi non capisco dov' l'errore

floyd
13-12-2002, 10:36
rs.getString(numero-colonna);
o
rs.getString("nome-colonna");

passi un nome che non esiste

Loading