The largest Interview Solution Library on the web


Interview Questions
« Previous | 0 | 1 | 2 | 3 | 4 | Next »

81.What is the use of (c:remove ) tag?

The tag removes a variable from either a specified scope or the first scope where the variable is found ifnoscopeisspecified.

82.What is the use of (c:catch) tag?

The (c:catch) tag catches any Throwable that occurs in its body and optionally exposes it. Simply it is used for error handling and to deal more gracefully with the problem.

83.What is the use of (c:if) tag?

The tag evaluates an expression and displays its body content only if the expression evaluates to true.

84.What is the use of (c:choose) tag?

The (c:choose) works like a Java switch statement in that it lets you choose between a number of alternatives. Where the switch statement has case statements, the (c:choose) tag has (c:when) tags. A a switch statement has default clause to specify a default action and similar way (c:choose) has (otherwise) as default clause.

85.What is the use of (c:forEach ), (c:forTokens) tag?

The (c:forEach ), (c:forTokens) tags exist as a good alternative to embedding a Java for, while, or do-while loop via a scriptlet.

86.What is the use of (c:param) tag?

The (c:param) tag allows proper URL request parameter to be specified with URL and it does any necessary URL encoding required.

87.What is the use of (c:redirect ) tag?

The tag redirects the browser to an alternate URL by providing automatically URL rewriting, it supports context-relative URLs, and it supports the (c:param) tag.

88.What is the use of tag?

The (c:url) tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary.

89.What are JSTL formatting tags ?

The JSTL formatting tags are used to format and display text, the date, the time, and numbers for internationalized Web sites. Following is the syntax to include Formatting library in your JSP:
<%@ taglib prefix="fm t" uri="http://java.sun.com /jsp/jstl/fm t" %>

90.What are JSTL SQL tags?

The JSTL SQL tag library provides tags for interacting with relational databases RDBMSs such as Oracle, mySQL, or Microsoft SQL Server.
Following is the syntax to include JSTL SQL library in your JSP:
<%@ taglib prefix="sql" uri="http://java.sun.com /jsp/jstl/sql" %>

91.What are JSTL XML tags?

The JSTL XML tags provide a JSP-centric way of creating and manipulating XML documents. Following is the syntax to include JSTL XML library in your JSP.
<%@ taglib prefix="x" uri="http://java.sun.com /jsp/jstl/xm l" %>

92.What is a JSP custom tag?

A custom tag is a user-defined JSP language element. When a JSP page containing a custom tag is translated into a servlet, the tag is converted to operations on an object called a tag handler. The Web container then invokes those operations when the JSP page's servlet is executed.

93.What is JSP Expression Language?

JSP Expression Language EL makes it possible to easily access application data stored in JavaBeans components. JSP EL allows you to create expressions both a arithmetic and b logical. A simple syntax for JSP EL is :
$ {expr}
Here expr specifies the expression itself.

94.What are the implicit EL objects in JSP ?

The JSP expression language supports the following implicit objects:

  • pageScope: Scoped variables from page scope
  • requestScope: Scoped variables from request scope
  • sessionScope: Scoped variables from session scope
  • applicationScope: Scoped variables from application scope
  • param: Request parameters as strings
  • paramValues: Request parameters as collections of strings
  • headerHTTP: request headers as strings
  • headerValues: HTTP request headers as collections of strings
  • initParam: Context-initialization parameters
  • cookie: Cookie values
  • pageContext: The JSP PageContext object for the current page

95.How can we disable EL ?

We can disable using isELIgnored attribute of the page directive:
If it is true, EL expressions are ignored when they appear in static text or tag attributes. If it is false, EL expressions are evaluated by the container.

96.What type of errors you might encounter in a JSP code?

  • Checked exceptions: Achecked exception is an exception that is typically a user error or a problem that cannot be foreseen by the programmer. For example, if a file is to be opened, but the file cannot be found, an exception occurs. These exceptions cannot simply be ignored at the time of compilation.
  • Runtime exceptions: A runtime exception is an exception that occurs that probably could have been avoided by the programmer. As opposed to checked exceptions, runtime exceptions are ignored at the time of compliation.
  • Errors: These are not exceptions at all, but problems that arise beyond the control of the user or the programmer. Errors are typically ignored in your code because you can rarely do anything about an error. For example, if a stack overflow occurs, an error will arise. They are also ignored at the time of compilation.

97.In JSP page how can we handle runtime exception?

We can use the errorPage attribute of the page directive to have uncaught run-time exceptions automatically forwarded to an error processing page.
Example: <%@ page errorPage="error.jsp" %>
It will redirect the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing. Within error.jsp, will have to indicate that it is an error-processing page, using the directive:
<%@ page isErrorPage="true" %>

98.What is Internationalization?

Internationalization means enabling a web site to provide different versions of content translated into the visitor's language or nationality.

99.What is Localization?

Localiztion means adding resources to a web site to adapt it to a particular geographical or cultural region for example Hindi translation to a web site.

100.What is locale?

This is a particular cultural or geographical region. It is usually referred to as a language symbol followed by a country symbol which are separated by an underscore. For example "en_US" represents english locale for US.

« Previous | 0 | 1 | 2 | 3 | 4 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com