Really a strange problem, isn't it?
For your reference, please try the following:
        First, try "http://localhost:8080/newscont.jsp?no=123";;
        Second, check to ensure that the page who calls "newscount.jsp"
 correctly uses the METHOD of "POST" or "GET" (with "GET" as default);
At last, I recommend such a coding pattern as follows:
        int no = 0;
        try {
                no = Integer.parseInt(request.getParameter("no"));
        } catch (Exception e) {
                System.err.println("Exception: " + e);
        }
        // now the integer variable of "no" can be used carefree
Happy coding!

-----Original Message-----
From: yilmaz [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 19, 2001 11:46 AM
To: [EMAIL PROTECTED]
Subject: Re: 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 tried calling the jsp without any parameter (
http://localhost:8080/newscont.jsp) and
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 ??? (:(-

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to