----- Original Message -----
Sent: Friday, October 19, 2001 3:59
PM
Subject: SV: help me with this "
numberformat exception" please
Ok,
you hav eto check a few things, first, how do you send the parameter to the
page? POST or GET (default).
You
cannot just comment the checks for null value (since it can be in a class or
something) without comment the whole block. The easiest way should be to set a
false && in the start of you if case...
like
if(false && no != null && ...)
this
way, it will never go into that codeblock...
But
since you have tested some, you might dont this (or a similar way) and then
you know that the problem isn't in just that codeblock.
Have
you tried (as a wrote before) to just take the no part? excuding the sql
statement and mysql driver a.s.o. ?
here
is how I locates error if i can't find them
1)
Start with all the code (you get the error)
2)
By the errormessage, guess where the error can be
3)
Try to set the variable in the code (not to make it dynamic) so you know that
it will work (test the sql statement sepratly also) Try setting all variables
that can be involved with the problem
4)
Start cut pieces of you code out and lay it in a notepad window (NOTE: Do a
backup of the source before or something so if your computer crashes, you can
restore it)
5)
Compile and test.... still same error? Go back to 4 and remove some more code,
do step 5 again
6)
now you have located a part of the code where the error probably is, and it
shouldn't be hard to figure out how to fix it (unless there is a hardware or
configuration error in another program, but as log it is a
code-error)
This
method takes some time and I only use it when I can't figure out what and
where the problem is. When you find where the problem is and donät know what
to do, you know exacly what to ask someone, knowing that it is the specific
line that causes the error
Since you get a error when you compile (what I can
see) the problem may lie in you apache config. I'm not good at all in
configuring apache but many others on the JSP-list seems to have a good hang
of it.
Hope
I helped some
//
Jan
Hi Jan,
----- Original Message -----
Sent: Friday, October 19, 2001 2:07
PM
Subject: SV: help me with this "
numberformat exception" please
Thank you David, Horwat and Sankar for
your help,
my JSP just can't see the
parameters.
i get the same numberformat exception, i
think it can't even see that
there is a parameter at the end of
the url. What can be wrong ?
according to your advices i changed my code
as follows :
<%
Class.forName("org.gjt.mm.mysql.Driver");
String no=request.getParameter("no"); /* i also tried with
int no=request.getParameter("no"/no) didn't work either
*/
no=no.trim();
if
((no!=null) && (no.length()!=0)){
out.println("the
value of no : "+ no);
try {
conn =
DriverManager.getConnection("jdbc:mysql:///yilmaz");
String sql="select ndate,subject,news
from new where no="+no;
stmt =
conn.createStatement (sql);
out.println("sql string is
:" + sql);
rs = stmt.executeQuery (); .....it goes
on...
still i am having this error : Any idea ???
(:(-
org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:543)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:458)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:215)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2314)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1000)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1093)
at java.lang.Thread.run(Thread.java:484)
Root Cause:
java.lang.NumberFormatException: mysql
at java.lang.Integer.parseInt(Integer.java:414)
at java.lang.Integer.parseInt(Integer.java:463)
at org.apache.jasper.compiler.Compiler.getJspLineErrors(Compiler.java:321)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:280)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:528)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:458)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:215)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2314)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1000)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1093)
at java.lang.Thread.run(Thread.java:484)