JSP: Utilisation de tableaux Multidimensionnels


  
    Using Multidimensional Arrays
  
  
    

Using Multidimensional Arrays

    <%         double accounts[][] = new double[2][100];         accounts[0][3] = 11.09;         accounts[1][3] = 19.07;         out.println("Savings Account 3 holds $" + accounts[0][3] + "
");         out.println("Checking Account 3 holds $" + accounts[1][3]);      %>                       

JSP: Exemple de Catch multiple


    
        Catching an ArrayIndexOutOfBoundsException Exception
    
    
        

Catching an ArrayIndexOutOfBoundsException Exception

    <%     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);     }     %>                         

JSP: Utilisation de jspInit et jspDestroy


  
    Using jspInit and jspDestroy
  
  
    

Using jspInit and jspDestroy

    <%!     int number;     public void jspInit()     {       number = 5;     }     public void jspDestroy()     {       number = 0;     }     %>     <%     out.println("The number is " + number + "
");     %>                       

JSP: Informations Locales, Pays, Langue, Fuseaux Horaire, etc

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<fmt:message key="Welcome" bundle="i18n.WelcomeBundle" />

Here is your Locale info...

<%--   Locale:    Locale country:  Locale language: --%>                    

JSP: Créer un tableau en jsp


  
    Creating an Array
  
  
    

Creating an Array

    <%         double accounts[];         accounts = new double[100];         accounts[3] = 119.63;         out.println("Account 3 holds $" + accounts[3]);      %>