Category: FromSitesTree.com

IfExample.jsp Page that uses the custom nested tags #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

IfExample.jsp Page that uses the custom nested tags <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!– Illustration of IfTag tag. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. –> <HTML> <HEAD> <TITLE>If Tag Example</TITLE> <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css"> </HEAD> <BODY> <H1>If …

Continue reading

ForwardSnippet.java Partial servlet illustrating how to use a RequestDispatcher to forward requests #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

ForwardSnippet.java Partial servlet illustrating how to use a RequestDispatcher to forward requests public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String operation = request.getParameter("operation"); if (operation == null) { operation = "unknown"; } if (operation.equals("operation1")) { gotoPage("/operations/presentation1.jsp", request, response); } else if (operation.equals("operation2")) { gotoPage("/operations/presentation2.jsp", request, response); } else { gotoPage("/operations/unknownRequestHandler.jsp", request, response); …

Continue reading

An example Travel Site #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

quick-search.html Front end to travel site <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!– Front end to travel servlet. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. –> <HTML> <HEAD> <TITLE>Online Travel Quick Search</TITLE> <LINK REL=STYLESHEET HREF="travel-styles.css" TYPE="text/css"> </HEAD> <BODY> <BR> …

Continue reading

HeadingExample.jsp Page that uses the HeadingTag custom tag #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

HeadingExample.jsp Page that uses the HeadingTag custom tag <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!– Illustration of HeadingTag tag. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. –> <HTML> <HEAD> <TITLE>Some Tag-Generated Headings</TITLE> </HEAD> <BODY> <%@ taglib uri="cwp-taglib.tld" prefix="cwp" %> …

Continue reading

DebugTag.java Custom tag that optionally makes use of a tag body #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

DebugTag.java Custom tag that optionally makes use of a tag body package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import javax.servlet.*; /** A tag that includes the body content only if * the "debug" request parameter is set. * <P> * Taken from Core Web Programming Java 2 Edition * from Prentice Hall and Sun …

Continue reading

# DebugExample.jsp Page that uses the DebugTag custom tag #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

# DebugExample.jsp Page that uses the DebugTag custom tag <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!– Illustration of SimplePrimeTag tag. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. –> <HTML> <HEAD> <TITLE>Using the Debug Tag</TITLE> <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css"> </HEAD> …

Continue reading

FilterTag.java Custom tag that modifies the tag body #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

FilterTag.java Custom tag that modifies the tag body package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import cwp.*; /** A tag that replaces <, >, ", and & with their HTML * character entities (<, >, ", and &). * After filtering, arbitrary strings can be placed * in either the page body or in …

Continue reading

FilterExample.jsp Page that uses the FilterTag custom tag #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

FilterExample.jsp Page that uses the FilterTag custom tag <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!– Illustration of FilterTag tag. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. –> <HTML> <HEAD> <TITLE>HTML Logical Character Styles</TITLE> <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css"> </HEAD> <BODY> …

Continue reading

RepeatTag.java Custom tag that repeats the tag body a specified number of times #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

RepeatTag.java Custom tag that repeats the tag body a specified number of times package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; /** A tag that repeats the body the specified * number of times. * <P> * Taken from Core Web Programming Java 2 Edition * from Prentice Hall and Sun Microsystems Press, * . …

Continue reading

IfTag.java, IfConditionTag.java, IfThenTag.java, and IfElseTag.java, Custom tags that make use of tag nesting #Programming Code Examples #Java/J2EE/J2ME #Applets and Basic Graphics

IfTag.java, IfConditionTag.java, IfThenTag.java, and IfElseTag.java, Custom tags that make use of tag nesting IfTag.java package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import javax.servlet.*; /** A tag that acts like an if/then/else. * <P> * Taken from Core Web Programming Java 2 Edition * from Prentice Hall and Sun Microsystems Press, * . * May …

Continue reading