20_JSP - CSI 3540 Structures, techniques et normes du Web...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSI 3540 Structures, techniques et normes du Web Friday, March 26, 2010 Objectifs : 1. Concevoir des documents JSP 2. Se familiariser avec le langage dexpression (EL) et les JavaBeans Lectures : Web Technologies (2007) 8 Pages 447463 Sparer la programmation de la prsentation laide de JSP Friday, March 26, 2010 Plan 1.Expression Language (EL) 2.JavaBeans et JSP 3.Bibliothques de balises JSTL 4.MVC et JSP Friday, March 26, 2010 Introduction Les documents JSP 2.0 (et +) sont des applications XML Lors de la premire visite (ou avant), le document est traduit en Java (Servlet) puis compil, pour les prochaines visites, la forme compile est utilise Friday, March 26, 2010 Servlet correspondant au document JSP Document JSP Conteneur JSP Serveur Web Client Requte Requte Requte Rponse Rponse Rponse Traduction Friday, March 26, 2010 Introduction < html xmlns:core = "http://java.sun.com/jsp/jstl/core" xmlns:jsp = "http://java.sun.com/JSP/Page" xmlns = "http://www.w3.org/1999/xhtml" > < jsp : useBean id = "date" class = "java.util.Date" /> < head > < title >La date du jour</ title > </ head > < body style = "font-size:x-large" > < h2 >Voici la date du jour :</ h2 > < p > < core : out value = "${date}" /> </ p > </ body > </ html > Friday, March 26, 2010 lments JSP (3 types) scriptage : permet linsertion de code Java dans les documents JSP, par exemple <jsp:declaration> (variables dinstance ou de classe), <jsp:scriptlet> , <jsp:expression> consignes : <jsp:directive.page contentType=.../> <jsp:directive.include fle=Footer.jspF/> Friday, March 26, 2010 <html ...> ... <body> <h1>Scriptlet</h1> <p> < jsp : declaration > String date = ( new java.util.Date() ).toString(); </ jsp : declaration > < jsp : scriptlet > out.write( date ); </ jsp : scriptlet > </p> <h1>Expression</h1> <p> < jsp : expression > d a t e </ jsp : expression > </p> </body> </html> Friday, March 26, 2010 lments JSP (3 types) actions : Prdfnies (standard actions) useBean, setProperty, getProperty, forward... Dfnies par lusager, laide des mcanismes de JSTL (JSP Standard Tag Library) Friday, March 26, 2010 lments JSP et les espaces de nommage < html xmlns:core = "http://java.sun.com/jsp/jstl/core" xmlns:jsp = "http://java.sun.com/JSP/Page" xmlns = "http://www.w3.org/1999/xhtml" > < jsp : useBean id = "date" class = "java.util.Date" /> .... </ html > < html xmlns:core = "http://java.sun.com/jsp/jstl/core" xmlns:page = "http://java.sun.com/JSP/Page" xmlns = "http://www.w3.org/1999/xhtml" > < page : useBean id = "date" class = "java.util.Date" /> .... </ html > Friday, March 26, 2010 Resources Une ressource tonnamment brve et trs utile JavaServer Pages (JSP) v2.0 Syntax Reference [ http://java.sun.com/products/ jsp/syntax/2.0/syntaxref20.html ] 2008-03-05 Rfrence complte (1126 pages) http://java.sun.com/javaee/5/docs/ tutorial/doc/JavaEETutorial.pdf Friday, March 26, 2010 <html xmlns:core="http://java.sun.com/jsp/jstl/core"<html xmlns:core="http://java....
View Full Document

Page1 / 86

20_JSP - CSI 3540 Structures, techniques et normes du Web...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online