SlideServe
Menu
Préférences
© SlideServe · v2026

Best Practices and Example JSP Application Development

deon avatar
11 diapositives · 258 Views · Jul 16, 2014

This document outlines the essential structures and best practices for developing web applications using JavaServer Pages (JSP). It covers crucial components, including directives, declarations, expressions, and scriptlets, providing examples to illustrate each concept. The document emphasizes the utilization of directives to organize JSP pages effectively and includes practical examples of how to implement them in a web application context. Learn how to structure your JSP pages for optimal performance and maintainability in web application development.

Best Practices and Example JSP Application Development - slide 1
01 / 11Best Practices and Example JSP Application Development
1 / 17

Télécharger la présentation

Best Practices and Example JSP Application Development
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. JSP Example and Best Practices Minpo, Jung

  2. Web Application Architecture

  3. Patterns for Web Application Development Servlet model

  4. Moving to JSP Model 1

  5. Moving to JSP Model 2

  6. JSP Processing

  7. Structure of a JSP Page • JSP page = directives + declarations + expressions + scriptlets

  8. Directives • An example of the page directive <%@ page import="java.util.Date, java.io.*“ extends="myJSPpage“ buffer="32k" autoflush="false" %> <jsp:directive.page import="java.util.Date, java.io.* " extends="myJSPpage" buffer="32k" autoflush="false" /> <%@ include file="/legal/disclaimer.html"> <jsp:directive.include file="/templates/footer.html" />

  9. Declarations <%! int balance = 0; %> <%! public int getAccountBalance() { return balance; } %> <jsp:declaration> int balance = 0; </jsp:declaration> <jsp:declaration> public int getAccountBalance() { return balance; } </jsp:declaration>

  10. Expressions • Hello, my name is <%= getName() %>. How are you? • out.println("Hello, my name is "+ getName() + ". How are you?"); • <% StringBuffer sb = new StringBuffer(); • sb.append("Hello, my name is ""); • sb.append(getName()); • sb.append(". How are you?); • out.println(sb.toString()); • %> <jsp:expression></jsp:expression>

  11. Scriptlets • <% for (int n=0; n<10; n++) { • out.println(n); • out.println("<br>"); // Line break • } • %> • <jsp:scriptlet> • for (int n=0; n<10; n++) { • out.println(n); • out.println("<br>"); // Line break • } • </jsp:scriptlet>