Programming Tutorials

Interview Tutorials

41. What are all the different scope values for the tag?

By: Karthik : 2012-06-16

Description: Answer:<jsp:useBean> tag is used to use any java object in the jsp page. Here are the scope values for <jsp:useBean> tag:


42. What is JSP Output Comments?

By: Karthik : 2012-06-16

Description: JSP Output Comments are the comments that can be viewed in the HTML source file.


43. What is expression in JSP?

By: Karthik : 2012-06-16

Description: Expression tag is used to insert Java values directly into the output. Syntax for the Expression tag


44. What types of comments are available in the JSP?

By: Karthik : 2012-06-16

Description: There are two types of comments are allowed in the JSP. These are hidden and output comments. A hidden comments does not appear in the generated output in the html, while output comments appear in the generated output.


45. What is JSP declaration?

By: Karthik : 2012-06-16

Description: JSP Decleratives are the JSP tag used to declare variables. Declaratives are enclosed in the <%! %> tag and ends in semi-colon. You declare variables and functions in the declaration tag and can use anywhere in the JSP. Here is the example of declaratives:


46. What is JSP Scriptlet?

By: Karthik : 2012-06-16

Description: JSP Scriptlet is jsp tag which is used to enclose java code in the JSP pages. Scriptlets begins with <% tag and ends with %> tag. Java code written inside scriptlet executes every time the JSP is invoked.


47. What are the life-cycle methods of JSP?

By: Karthik : 2012-06-16

Description: The container calls the jspInit() to initialize the servlet instance. It is called before any other method, and is called only once for a servlet instance.


48. What is the difference between interface and abstract class?

By: Karthik : 2012-06-16

Description: interface contains methods that must be abstract; abstract class may contain concrete methods.


49. Question: Difference between forward and sendRedirect in JSP?

By: Guru Singh : 2008-08-24

Description: When you invoke a forward request, the request is sent to another resource on the server, without the client being informed that a different resource is going to process the request. This process occurs completely with in the web container. When a sendRedirtect method is invoked, it causes the web container to return to the browser indicating that a new URL should be requested. Because the browser issues a completely new request any object that are stored as request attributes before the redirect occurs will be lost. This extra round trip a redirect is slower than forward.


50. Question: What is an Expression tag in JSP?

By: Guru Singh : 2008-08-24

Description: An expression tag contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file. Because the value of an expression is converted to a String, you can use an expression within text in a JSP file.