Total members 10262 | Gratitudes |It is currently Thu May 24, 2012 10:22 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Question
 Question subject: JSP Tutorial 101
PostPosted: Tue Dec 07, 2010 10:48 pm 
Offline
Newbie
User avatar

Joined: Thu Nov 18, 2010 11:56 am
Posts: 49
Has thanked: 0 time
Have thanks: 15 time

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


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 SEO Tutorial
 Java Reverse Engineering Tutorial.pdf
 photoshop tutorial
 Cisco - IPV6 tutorial (slides)
 cisco - MPLS tutorial (Slides)
 java assertions video tutorial
 JSP tutorial
 Brewing Java: A Tutorial
 j2me tutorial for 3d

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team