Hello,

I have some code that roughly resembles this, where the integers are valid integers.  
For some reason, I keep getting NumberFormatExceptions that I can't reproduce.  I've 
done some printlns when I get the exceptions, and it's showing str1 and/or str2 as 
null.  But, the guard clause should catch that. To make it more frustrating, these 
errors wind up killing the connector so my site is down completely.  Restart JRun3.0 
and everything is good until next time.  Has anyone run into anything similar or have 
any ideas?  NT4, IIS4...
                
doGet(...)
{
        String str1 = req.getParameter( "str1" );
        String str2 = req.getParameter( "str2" );

        try
        {
                if( str1 == null || str2 == null || "".equals( str1 ) || "".equals( 
str2 ))
                {
                        res.sendRedirect( "/directory/default.htm" );
                        return;
                }
        
                int num1 = Integer.parseInt( str1 );
                int num2 = Integer.parseInt( str2 );
        }
        catch( IOException ioe )
        {
                ...
        }
        catch( NumberFormatException nfe )
        {
                ...
        }
}

Kindest Regards,

Derek Nerenberg


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to