REGISTER FREE to Receive Instant Job

Monday, 8 December 2014

Jsp Interview questions

1- What is JSP?

JSP is the extension of Servlet that solves both these problems by facilitating embedding of Dynamic Content Generation Logic into HTML and Auto Generation of Servlets.
Each JSP page is translated into a Servlet which contains Dynamic Content Generation Logic as well as statements to write HTML contents to the output stream.

What is difference between hide comment and output comment?

The jsp comment is called hide comment whereas html comment is called output comment. If user views the source of the page, the jsp comment will not be shown whereas html comment will be shown.

What is JSP TAGS?

Following types of tags are used in JSP-
  • Scriptlet
  • Declaration
  • Directives
  • Expression
  • Action

What is difference between include directive & action?

  • include directive includes the contents of the specified resource to the response of JSP at the time of translation whereas include action includes the contents at the time of execution. In other words, in case of include directive includes the contents of the specified resource are included in line at the time of translation whereas in case of include action contents are dynamically included. 
  • include directive provides better performance as compared to include action.
  • include action provides more flexibility than include directive.
  • Include directive is used when contents of static resources are to be included and include action is used when dynamic contents are to be included.

What is Web Application Models?

Commonly used Web Application Models are-
  • Two-Tier model
  • Three-Tier Model
  • n-Tier model

How can I implement a thread-safe JSP page? What are the advantages and Disadvantages of using it?

You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive <%@ page isThreadSafe="false" %> within your JSP page.

Can we use the exception implicit object in any jsp page?

No. The exception implicit object can only be used in the error page which defines it with the isErrorPage attribute of page directive.

What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?

request.getRequestDispatcher(path) is used in order to create it we need to give the relative path of the resource whereas context.getRequestDispatcher(path) in order to create it we need to give the absolute path of the resource.

What is a basic difference between the JSP custom tags and java beans?

  • Custom tags can manipulate JSP content whereas beans cannot.
  • Complex operations can be reduced to a significantly simpler form with custom tags than with beans.
  • Custom tags require quite a bit more work to set up than do beans.
  • Custom tags are available only in JSP 1.1 and later, but beans can be used in all JSP 1.x versions.


2 comments:

Popular Posts

Powered by Blogger.

About Me

My photo

JobsAcid is a 'job search engine' to provide finding a job on the internet easier for the user. It has designed as huge selection of job offerings on the same search engine.