Total members 11890 |It is currently Wed Apr 24, 2024 3:39 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





What Is a JSP Page?

A JSP page is a text document that contains two types of text: static data, which can be expressed in any text-based format (such as HTML, SVG, WML, and XML), and JSP elements, which construct dynamic content.

The recommended file extension for the source file of a JSP page is .jsp. The page can be composed of a top file that includes other files that contain either a complete JSP page or a fragment of a JSP page. The recommended extension for the source file of a fragment of a JSP page is .jspf.

The JSP elements in a JSP page can be expressed in two syntaxes--standard and XML--though any given file can use only one syntax. A JSP page in XML syntax is an XML document and can be manipulated by tools and APIs for XML documents. (Just like php <?php ?>, you can put <% %> jsp tags inside in the HTML, XML etc. pages.)

The lines in bold in the example code contain the following types of JSP constructs:

1. A page directive (<%@page ... %>) sets the content type returned by the page.
<%@ page contentType="text/html; charset=UTF-8" %>
2. Tag library directives (<%@taglib ... %>) import custom tag libraries.
<%@ taglib uri="/WEB-INF/functions.tld" prefix="f" %>
3. jsp:useBean creates an object containing a collection of locales and initializes an identifier that points to that object.
<jsp:useBean id="locales" scope="application" class="mypkg.MyLocales"/>
4. JSP expression language expressions (${ }) retrieve the value of object properties. The values are used to set custom tag attribute values and create dynamic content.
<c:if test="${selectedFlag}" >
5. Custom tags set a variable (c:set), iterate over a collection of locale names (c:forEach), and conditionally insert HTML text into the response (c:if, c:choose, c:when, c:otherwise).
6. jsp:setProperty sets the value of an object property.
7. A function (f:equals) tests the equality of an attribute and the current item of a collection. (Note: A built-in == operator is usually used to test equality).

Next Tutorial - Introduction to Web Applications.



_________________
Coding my life with Java, PHP, JavaScript, and Python


Author:
Newbie
User avatar Posts: 39
Have thanks: 15 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : JSP Tutorial 101
 JSP tutorial     -  
 SEO Tutorial     -  
 C Tutorial     -  
 photoshop tutorial     -  
 Brewing Java: A Tutorial     -  
 java assertions video tutorial     -  
 Java Reverse Engineering Tutorial.pdf     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com