InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Explain Jstl Out Tag? |
|
Answer» JSTL out TAG: The out tag is used to evaluate an expression and write the result to JspWriter. For Example : <%@ taglib uri="HTTP://java.sun.com/jsp/jstl/core" prefix="c" %> The value attribute specifies the expression to be written to the JspWriter. The default attribute specifies the value to be written if the expression evaluates null. JSTL out tag: The out tag is used to evaluate an expression and write the result to JspWriter. For Example : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> The value attribute specifies the expression to be written to the JspWriter. The default attribute specifies the value to be written if the expression evaluates null. |
|
| 2. |
Explain Jstl Choose, When, Otherwise Tag With An Example? |
|
Answer» JSTL choose, when, otherwise tag: These are conditional tags used to implement conditional operations. If the test condition of the when tag evaluates to true, then the content within when tag is evaluated, otherwise the content within the otherwise tag is evaluated. We can also implement if-else-if construct by USING multiple when tag. The when tags are mutually EXCLUSIVE, that means the first when tag which evaluates to true is evaluated and then, the control exits the choose BLOCK. If none of the when condition evaluates to true, then otherwise condition is evaluated. For EXAMPLE <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> JSTL choose, when, otherwise tag: These are conditional tags used to implement conditional operations. If the test condition of the when tag evaluates to true, then the content within when tag is evaluated, otherwise the content within the otherwise tag is evaluated. We can also implement if-else-if construct by using multiple when tag. The when tags are mutually exclusive, that means the first when tag which evaluates to true is evaluated and then, the control exits the choose block. If none of the when condition evaluates to true, then otherwise condition is evaluated. For Example <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
|
| 3. |
Explain Jstl Catch Tag With An Example? |
|
Answer» JSTL catch tag: The JSTL catch tag is used to handle exception and doesn't forward the PAGE to the error page. For Example : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> JSTL catch tag: The JSTL catch tag is used to handle exception and doesn't forward the page to the error page. For Example : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> |
|
| 4. |
Explain Jstl Foreach Tag With An Example? |
|
Answer» JSTL forEach TAG: This tag provides a mechanism for iteration within a JSP page. JSTL forEach tag works similarly to enhanced for loop of Java Technology. You can use this tag to iterate over an existing collection of items. For Example : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="C" %> <HTML> Here the attribute items has its value as an EL expression which is a collection of ERROR messages. Each item in the iteration will be stored in a variable called message which will be available in the body of the forEach tag. JSTL forEach tag: This tag provides a mechanism for iteration within a JSP page. JSTL forEach tag works similarly to enhanced for loop of Java Technology. You can use this tag to iterate over an existing collection of items. For Example : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> Here the attribute items has its value as an EL expression which is a collection of error messages. Each item in the iteration will be stored in a variable called message which will be available in the body of the forEach tag. |
|
| 5. |
Explain Jstl If Tag With An Example? |
|
Answer» The if tag is a conditional tag used to EVALUATE conditional expressions. When a body is supplied with if tag, the body is evaluated only when the expression is true. For EXAMPLE : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" PREFIX="c" %> <html> The if tag is a conditional tag used to evaluate conditional expressions. When a body is supplied with if tag, the body is evaluated only when the expression is true. For Example : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> |
|
| 6. |
List Some Jstl Sql Tags? |
Answer»
|
|
| 7. |
List Some Formatting Tags? |
|
Answer» Formatting TAGS Descriptions :
Formatting Tags Descriptions : |
|
| 8. |
List Some Function Tags? |
|
Answer» JSTL Function Tags List :
JSTL Function Tags List :
|
|
| 9. |
List Some Jstl Core Tags? |
|
Answer» JSTL Core Tags :
JSTL Core Tags : |
|
| 10. |
Explain Sql Tags? |
|
Answer» SQL tags : JSTL SQL Tags: JSTL SQL Tags PROVIDE support for interaction with relational databases such as Oracle, MySql etc. USING JSTL SQL tags we can run database queries, we include these JSTL tags in JSP with below syntax: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" PREFIX="sql" %> SQL tags : JSTL SQL Tags: JSTL SQL Tags provide support for interaction with relational databases such as Oracle, MySql etc. Using JSTL SQL tags we can run database queries, we include these JSTL tags in JSP with below syntax: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> |
|
| 11. |
Explain Xml Tags? |
|
Answer» JSTL XML Tags: JSTL XML tags are used to work with XML DOCUMENTS such as parsing XML, TRANSFORMING XML DATA and XPath expressions evaluation. Syntax to include JSTL XML tags in JSP page is: <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="X" %> JSTL XML Tags: JSTL XML tags are used to work with XML documents such as parsing XML, transforming XML data and XPath expressions evaluation. Syntax to include JSTL XML tags in JSP page is: <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %> |
|
| 12. |
Explain Formatting Tags? |
|
Answer» Formatting tags: JSTL Formatting tags are PROVIDED for formatting of Numbers, Dates and i18n support through locales and resource bundles. We can include these jstl tags in JSP with below syntax: <pre class="prettyprint"> <%@ taglib URI="http://java.sun.com/jsp/jstl/FMT" PREFIX="fmt" %> Formatting tags: JSTL Formatting tags are provided for formatting of Numbers, Dates and i18n support through locales and resource bundles. We can include these jstl tags in JSP with below syntax: <pre class="prettyprint"> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> |
|
| 13. |
Explain Function Tags? |
|
Answer» Function tags: JSTL Functions Tags: JSTL tags provide a number of functions that we can USE to perform common operation, most of them are for String manipulation such as String Concatenation, Split String etc. Syntax to include JSTL functions in JSP page is: <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="FN" %> Function tags: JSTL Functions Tags: JSTL tags provide a number of functions that we can use to perform common operation, most of them are for String manipulation such as String Concatenation, Split String etc. Syntax to include JSTL functions in JSP page is: <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> |
|
| 14. |
Explain Jstl Core Tags? |
|
Answer» JSTL Core tags provide support for iteration, CONDITIONAL logic, catch exception, url, forward or REDIRECT RESPONSE etc. To USE JSTL core tags, we should include it in the JSP page like below. <%@ TAGLIB uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> JSTL Core tags provide support for iteration, conditional logic, catch exception, url, forward or redirect response etc. To use JSTL core tags, we should include it in the JSP page like below. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
|
| 15. |
How Many Tags Are Provided By Jstl? What Are They? |
|
Answer» There JSTL mainly PROVIDES 5 types of tags:
There JSTL mainly provides 5 types of tags: |
|
| 16. |
What Are The Advantage Of Jstl? |
Answer»
|
|
| 17. |
What Is Implicit Object? |
|
Answer» JSP Implicit Objects are the JAVA objects that the JSP CONTAINER makes available to developers in each page and DEVELOPER can call them directly without being explicitly DECLARED. JSP Implicit Objects are also CALLED pre-defined variables. JSP Implicit Objects are the Java objects that the JSP Container makes available to developers in each page and developer can call them directly without being explicitly declared. JSP Implicit Objects are also called pre-defined variables. |
|
| 18. |
What Is A Tag Library? |
|
Answer» The JavaServer Pages Standard Tag Library (JSTL) is a component of the Java EE Web application DEVELOPMENT platform. It extends the JSP SPECIFICATION by ADDING a tag library of JSP tags for common tasks, such as XML data processing, conditional EXECUTION, database access, LOOPS and internationalization. The JavaServer Pages Standard Tag Library (JSTL) is a component of the Java EE Web application development platform. It extends the JSP specification by adding a tag library of JSP tags for common tasks, such as XML data processing, conditional execution, database access, loops and internationalization. |
|
| 19. |
What Is A Taglib? |
|
Answer» JSP - The taglib Directive. Advertisements. The JavaServer Pages API allows you to define custom JSP tags that look like HTML or XML tags and a tag LIBRARY is a SET of user-defined tags that implement custom behavior. ... When you use a custom tag, it is typically of the form <prefix:tagname>. JSP - The taglib Directive. Advertisements. The JavaServer Pages API allows you to define custom JSP tags that look like HTML or XML tags and a tag library is a set of user-defined tags that implement custom behavior. ... When you use a custom tag, it is typically of the form <prefix:tagname>. |
|