Home > DeveloperSection > Interviews > What is a Scriptlet?

Posted on    May-05-2011 12:25 AM

 Java Java 
 1 Answer(s)
  733  View(s)
Rate this:

Amit Singh

Total Post:565

Posted on    May-05-2011 12:00 AM

A scriptlet can contain any number of language statements, variable or method declarations, or expressions that are valid in the page scripting language.Within scriptlet tags, you can

1.Declare variables or methods to use later in the file (see also Declaration).

2.Write expressions valid in the page scripting language (see also Expression).

3.Use any of the JSP implicit objects or any object declared with a <jsp:useBean> tag.
You must write plain text, HTML-encoded text, or other JSP tags outside the scriptlet.

Scriptlets are executed at request time, when the JSP engine processes the client request. If the scriptlet produces output, the output is stored in the out object, from which you can display it.

Don't want to miss updates? Please click the below button!

Follow MindStick