What are JSP Directives?
Answers were Sorted based on User's Feedback
Answer / vij
A directive is a way for you to give special instruction to
the container at page translation time.
3 flavours
page
include
taglib
| Is This Answer Correct ? | 30 Yes | 2 No |
Answer / gowri
1)page directive
2)include directive
3)taglib directive
| Is This Answer Correct ? | 20 Yes | 4 No |
Answer / akash srivastava
JSP directives are used to specify the attributes of
pages.Using directives we can even import some packages.So
using the directive statement we have specified the
packages that has to be imported...
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / guest
A JSP directive affects the overall structure of the servlet
class. it usually has the following form:
<%@ directive attribute="value" %>
How ever , you can also combine multiple attribute settings
for a single directive, as follows:
<%@ directive attribute1="value1" attribute2="value2" --
attrubuteN="value N" %>
These are two main types of diretive:page, which lets to
do things like import classes,customize the servlet
superclass, and the like; and include,which lets to insert a
file into the servlet class at the time the JSP file is
translated into a servlet.
| Is This Answer Correct ? | 11 Yes | 4 No |
Answer / naresh
there are 3 directives in JSP
1)<%page...%>
2)<%include...%>
3)<%taglib...%>
| Is This Answer Correct ? | 10 Yes | 4 No |
jsp directives are used to avoid java code from jsp.
jsp directives are 1.page 2.include and 3.taglib.
Attributes for page direcites are
import,language,contentType,errorPage,isErrorPage,buffer,autoFlush,
session,threadSafe,extends,info,pageEncoding and isELIngnored
Attributes for include directives are
page and file
Attributes for Taglib directive are
uri,prefix and tagdir
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / pradeep gupta
when jsp pages translate into the servlet when directive
provides the infomation to the jsp engine.
| Is This Answer Correct ? | 6 Yes | 4 No |
Answer / anurag
Define JSP directives.
-The page directive
-The include directive
-The taglib directive
Page directive:
The page directive allows to apply different attributes that
is to be added to a JSP. These attributes gives special
processing information to the JSP engine which allows the
way of processing JSP pages. The following are the various
page directives that are used in JSP
language
extends
import
session
buffer
autoFlush
isThreadSafe
info
errorPage
IsErrorPage
contentType
The syntax of any page directive is : <% @page optional
parameters …..> , where optional parameters can be any one
of the above directives.
Include directive:
The include directive is used to insert a static file which
will parse the JSP elements. The syntax is : <% @include
file = jsp file %>
Ex:
<% @include file=login.jsp %>
The included file can be a static file such as HTML or a
dynamic page such as JSP file. If the file is a JSP page ,
the JSP elements are parsed and their results are included
in the current JSP page.
Tag Libraries:
JSP technology supports the development of reusable
components called custom actions. A custom action is invoked
by the custom tag. A tab library is a set of custom tags.
Examples are form processing, accessing databases and other
enterprise services such as email , flow controls etc. JSP
tag libraries are used be web developers who are focused on
presenting issues.
The following are the some of the features of JSP custom tags:
The custom tags can be customized through the passing
the attributes from the calling page.
They can be accessed by all the available objects of JSP
page.
The response of the generated page can be modified by
custom tags by calling the page.
They can create and initialize a java bean component in
order to communicate each other.
Complex interaction can be done with JSP page by nesting
the custom tags..
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / sumana
in directives we can import the package .deffine error
handling pages or the session information of jsp page
| Is This Answer Correct ? | 2 Yes | 12 No |
What is the use of jstl?
write a program in javasacript to shake the window
Explain how you understand the action tag and jsp action elements.
How to get session in Jsp other than session object?
Java Server Page I can use a function in two ways: Either I declare <jsp:useBean id="myBean" scope="session" class="mypack.mysubpack.MyClass" /> or I declare <%@ page import = "mypack.mysubpack.MyClass" %> In each case I can call a function later by coding MyClass.myFunction(); So what is the difference between the two variantes? Why are Beans invented if we don't need them because we have the import statement ? please guide me its an humble request to you reader if u know n i'll be thankful to you...........
What is context in jsp?
Can constructor be used instead of init(), to initialize servlet?
What are the components that make up a tag library in jsp?
how to maintain sessions in jsp?can you tellme the methods.
16 Answers IBM, Scope International, TCS,
How do I view a jsp file?
Give an example of using your own tags.
Which tag should be used to pass information from jsp to include jsp?