Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

in linea

Domestico Codici sorgente E-Libri Trasferimenti dal sistema centrale verso i satelliti Metterseli in contatto con Circa noi

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


JSP Tags

Previous Next





Using JSP tags

  • Declaration tag
  • Expression tag
  • Directive tag
  • Scriptlet tag
  • Action tag



Declaration tag

Declaration tag ( <%! %> )
  • It allows the developer to declare variables or methods.
  • Start with <%! and End with %>
  • Code placed inside this tag must end in a semicolon ( ; ).
Le dichiarazioni non generano l'uscita in modo da sono usate con le espressioni o gli scriptlets di JSP. Per esempio,


<%!
private int counter = 0 ;
private String get Account ( int accountNo) ;
%>




Expression tag
Expression tag ( <%= %>)

Expression tag allow the developer to embed any Java expression and is short for out.println().
 
A semicolon ( ; ) does not appear at the end of the code inside the tag.
 
e.g.to show the current date and time.


Date : <%= new java.util.Date() %>



Directive tag
Direcitve tag ( <%@ directive...>)

Un indirizzamento di JSP fornisce le informazioni speciali sulla pagina al motore di JSP.

Tre tipi principali di indirizzamenti sono:
 
1)     page - processing information for this page.
2)     Include - files to be included.
3)     Tag library - tag library to be used in this page.
 

Gli indirizzamenti non producono alcun'uscita visibile quando la pagina è chiesta ma cambiare il senso che il motore di JSP procede la pagina.
 

per esempio, potete rendere i dati di sessione non disponibili ad una pagina regolando una pagina direttiva (sessione) a falso.




1. Page Directive

Questo indirizzamento ha 11 attributo facoltativo che forniscono al motore di JSP le informazioni d'elaborazione speciali. Il 11 attributo differente con una descrizione sommaria è decribe in tabella data qui sotto:


Language Which language the file uses. <%@ page language = "java" %>
Extends

Superclass used by the JSP engine for the translated Servlet.

<%@ page extends = "com.taglib... %>
import

Import all the classes in a java package into the current JSP page. This allows the JSP page to use other java classes.

<%@ page import = "java.util.*" %>
session

oes the page make use of sessions. By default all JSP pages have session data available. There are performance benefits to switching session to false.

Default is set to true.
buffer

Controls the use of buffered output for a JSP page. Default is 8kb

<%@ page buffer = "none" %>
autoFlush Flush output buffer when full. <%@ page autoFlush = "true" %>
isThreadSafe

Can the generated Servlet deal with multiple requests? If true a new thread is started so requests are handled simultaneously.

 
info

Developer uses info attribute to add information/document for a page. Typically used to add author,version,copyright and date info.   

<%@ page info = "visualbuilder.com test
page,copyright 2001. " %>
errorPage

Different page to deal with errors. Must be URL to error page.

<%@ page errorPage = "/error/error.jsp" %>
IsErrorPage

This flag is set to true to make a JSP page a special Error Page. This page has access to the implicit object exception (see later).

 
contentType Set the mime type and character set of
the JSP.
 



2. Include directive

Permette che uno sviluppatore di JSP includa il soddisfare di una lima all'interno di un altro. Includere tipicamente le lime sono usati per navigazione, le intestazioni, le tabelle ed i footers che sono comuni alle pagine multiple.
 
Due esempi di usando includono le lime:

Ciò include il HTML da privacy.html trovato nell'indice di includ nella pagina corrente del jsp.


<%@ include file = "include/privacy.html" %>

o per includere un menu di naviagation (lima del jsp) ha trovato nell'indice corrente.

<%@ include file = "navigation.jsp" %>



3. Tag Lib directive
Un lib della modifica è una collezione di modifica su ordinazione che può essere usata dalla pagina.

<%@ taglib uri = "tag library URI" prefix = "tag Prefix" %>

La modifica su ordinazione è stata introdotta in JSP 1.1 e che permette che lo sviluppatore di JSP nasconda il codice complesso del lato dell'assistente dai progettisti di fotoricettore




Scriptlet tag
Scriptlet tag ( <% ... %> )

Between <% and %> tags,any valid Java code is called a Scriptlet. This code can access any variable or bean declared.   For example,to print a variable. 

<%
        String username = "visualbuilder" ;
        out.println ( username ) ;
  %>



Action tag
Ci sono tre ruoli principali della modifica di azione:
1)    It enable the use of server side Javabeans
2)    It transfer control between pages
3)    Browser independent support for applets.



Javabeans

Un Javabeans è un tipo speciale di codice categoria che ha un certo numero di metodi. La pagina di JSP può denominare questi metodo in modo da può lasciare la maggior parte del codice in questi Javabeans. Per esempio, se desideraste fare una forma di risposte che spedisce automaticamente un email. Avendo una pagina di JSP con una forma, quando l'ospite preme il tasto di presentazione questo trasmettere i particolari ad un Javabean che spedisce il email. Questo senso là sarebbe codice nella pagina di JSP che dealing with trasmettendo i email (JavaMail api) ed il vostro Javabeans potrebbe essere usato in altra pagina (che promuove riutilizzazione).
 
Per usare un Javabeans in una pagina di JSP usare la seguente sintassi:

<jsp : usebean id = " ...." scope = "application" class = "com..." />

Ciò che segue è una lista delle portate di Javabean:

page - valid until page completes.
request - bean instance lasts for the client request
session - bean lasts for the client session.
applicazione - il caso del fagiolo ha generato ed ultimi fino alle estremità di applicazione.





Previous Next

Keywords: JSP Tags, jsp custom tags, jsp action tags, jstl tags, jsp tag, tags in jsp, custom tags in jsp, jsp tag library, jsp custom tag, jsp tag libraries, jstl tag, custom tag in jsp, tag libraries in jsp, include tag in jsp, jsp include tag, tag library in jsp, jsp forward tag, jstl tag library, forward tag in jsp, jsp tag lib, jsp usebean tag, tags jsp, javax servlet jsp tagext tag, div tag in jsp, display tag in jsp, jsp custom tags tutorial, jsp tags in ibm websphere, usebean tag in jsp, select tag in jsp, jsp tag library tutorial, using jstl tags, action tags in jsp, jsp standard tag library, jsp custom tag library, jsp import tag, tag lib in jsp, jsp custom tag libraries, tag in jsp, servlet tag, taglib tag, using jsp custom tag, web xml tags, using jstl tag, request getparameter jsp, jsp source code


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.