PREVIOUS UP   Technologies Internet et Education, © TECFA
  6. JSP inside

6. JSP inside

Il n'est pas nécessaire de comprende le code java produit pour utiliser les pages JSP. Par contre il est utile de savoir lire une telle page approximativement pour comprendre des messages d'erreur

Mécanisme

Sécurité

Exemple 6-1: Java généré pour l'See JSP simple (1)

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
 
public class jsp__guides__jsp__ex__demo1_2ejsp extends org.gjt.jsp.HttpJspPageImpl{
 
   public final long _gnujspGetTimestamp() {
      return 948897919123L;
   }
   private static final String[] _gnujspDeps = new String[] { "/guides/jsp/ex/demo1.jsp" };
   public final String[] _gnujspGetDeps() {
      return _gnujspDeps;
   }
   public final long _gnujspGetCompilerVersion() {
      return 1999101701L;
   }
   public void _jspService (HttpServletRequest  request,
                            HttpServletResponse response)
       throws ServletException, IOException
   {
       response.setContentType ("text/html");
       JspFactory  factory     = JspFactory.getDefaultFactory ();
       PageContext pageContext = factory.getPageContext (this,request,response,
                                  null,true, 8192, true);
       HttpSession session   = pageContext.getSession ();
       ServletContext application = pageContext.getServletConfig().getServletContext();
       JspWriter   out       = pageContext.getOut ();
       ServletConfig config  = pageContext.getServletConfig();
       Object      page      = this;
 
       try {
 
// line:/guides/jsp/ex/demo1.jsp:1
out.print ("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'>\n<HTML>
\n  <HEAD>\n    <TITLE>JSP Test ( 1-Dec-1998)</TITLE>\n    <!-- Created by: D
.K.S.,  1-Dec-1998 -->\n    <!-- Changed by: D.K.S.,  1-Dec-1998 -->\n\n\n  <
/HEAD>\n  <BODY>\n    <H1>JSP Test</H1>\n\n\n<ul>\n      ");
// line:/guides/jsp/ex/demo1.jsp:16
 
      for (int i = 0; i < 5; i++) out.println ("<li>" + i);
 
// line:/guides/jsp/ex/demo1.jsp:18
out.print ("\n</ul>\n\n\n    <ADDRESS>\n      <A NAME='Signature'\n	 HREF=
'http://tecfa.unige.ch/tecfa-people/schneider.html'>D.K.S.</A>\n    </ADDRE
SS>\n  </BODY>\n</HTML>\n");
        } catch (Exception e) {
             out.clearBuffer ();
             pageContext.handlePageException (e);
        } finally {
             out.close ();
             factory.releasePageContext (pageContext);
        }
 
   }
 
}
 

PREVIOUS UP -- TIE