JSP: Exemple d’utilisation de interface

             {
                    localOut.println("Hello from JSP!");
                }
            }
        %>     
        <%
            localOut = out;  

JSP: Comment utiliser les méthodes surchargé en jsp.

        {
                public void breathe()  throws java.io.IOException 
                {
                    localOut.println("Gilling...
");          

JSP: Exemple de lecture des données binaires

         int numberBytes = fichierinputstream.available();
            byte bytearray[] = new byte[numberBytes];
            fichierinputstream.read(bytearray)

JSP: Création d’une page d’erreur


    
        Building a simple error handling page.
    
    
        <%
            try{
                int value = 1;
                value = value / 0;
            }
            catch (Exception e){
                System.out.println(e.getMessage());
            }
        %>
    

           
       

JSP: Utilisation des sessions en jsp

<%@ page errorPage="errorpage.jsp" %>

  
    UseSession
  
  
    <%
      Integer count = (Integer)session.getAttribute("COUNT");
      // If COUNT is not found, create it and add it to the session
      if ( count == null ) {
      
        count = new Integer(1);
        session.setAttribute("COUNT", count);
      }
      else {
        count = new Integer(count.intValue() + 1);
        session.setAttribute("COUNT", count);
      }  
      out.println("Hello you have visited this site: "
        + count + " times.");
    %>