quest4tech.net

 

Java Server Pages (JSP)

RESOURCES

JSP books UK
 
JSP Resource Index
JSP Tags

JSP books USA
 
JSP Insider
jGuru (JSP FAQ)


JSP Elements

Directives are used to give page specific information.
 
Directive Syntax Example
page <%@ page attribute = "value" %> <%@ page import = "java.util.*" %>
include <%@ include file = "url" %> <%@ include file = "info.htm" %>
taglib <%@ taglib uri = "identifier" prefix = "name" %> <%@ taglib uri = "web-info/myTags.tld" prefix = "c" %>

 
Scripting elements are used to give snippets of Java code or comments.
 
Scripting Syntax Example
Java declaration <%! declaration %> <%! int count %>
Scriptlet code <% code to execute" %> <% i = aValue * 1000 %>
Evaluated output <%= expression %> <%= new java.util.Date() %>
JSP comment <%-- comment --%> <%-- Only in JSP page --%>
HTML comment <!-- comment --%> <!-- Seen in html page --%>

 
Actions are programming commands that create, change or use other objects.
 
Action Syntax
useBean <jsp:useBean id = "beanName" />
include <jsp:include page = "url" flush = "boolean" />
setProperty <jsp:setProperty name = "beanName" property = "propertyName" %>
getProperty <jsp:getProperty name = "beanName" property = "propertyName" %>
forward <jsp:forward page = "relative url" />
plugin <jsp:plugin attribute = "value" />

 
Comparisons
 
Type Example
Scripting element <%! java.util.Date now = new java.util.Date(); %>
Action command <jsp:useBean id="now" class="java.util.Date" />

 
To add an entry or comment on an existing, please fill in the comments form


Return to Top

About Java

Main Index

(c) Compiled by B V Wood.

 Main Index
 Comments

UK SPONSERS


USA SPONSERS