Day 5

Quiz

A1: The different types of tags that can be used in a JSP page are directive, declaration, expression, scriptlet, and custom tags.
A2: A directive tag to set the MIME type for sending a GIF image file is
<%@ page contentType="image/gif"> 
A3: The include directive tag should be used in this case. Here is an example:
<%@ include file="/myhost/myapp/mySecondJSP.jsp" > 
A4: To define global variables in a JSP, that is, variables outside the service() method, the declaration tag should be used. An example of this is given here:
<%! 
// java variables instantiated here
String myStringVar = new String();
int intVar = 0;
%>
A5: The simplest tag to use for displaying values in a JSP is the expression tag. An example of this is
 Value of ...

Get Sams Teach Yourself BEA WebLogic Server 7.0™ in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.