JSP: Exemple de Catch multiple

Author:
       

    
        Plusieurs Exceptions
    
    
        

Gérer des multiples exceptions

    <%     try {         int array[] = new int[100];         array[100] = 100;     } catch (ArrayIndexOutOfBoundsException e) {         out.println("Array index out of bounds.");     } catch(ArithmeticException e) {         out.println("Arithmetic exception: " + e);     } catch(Exception e) {         out.println("An error occurred: " + e);     }     %>                         

Leave a Reply

Your email address will not be published. Required fields are marked *