Friday, 17 February 2012

What is JSP page? | Java JSP

A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format such as HTML, SVG, WML, and XML, and JSP elements, which construct dynamic content.

What is JSP technology? | Java JSP


Java Server Page is a standard Java extension that is defined on top of the servlet Extensions. The goal of JSP is the simplified creation and management of dynamic Web pages. JSPs are secure, platform-independent, and best of all, make use of Java as a server-side scripting language.

TOP 25 Java JSP Interview Questions and Answers for Freshers

Latest Java JSP Interview Questions and Answers for freshers
1 . What is JSP technology?
2 . What is JSP page?
3 . What are the implicit objects in JSP?
4 . How many JSP scripting elements and what are they?
5 . Why are JSP pages the preferred API for creating a web-based client program?
6 . Is JSP technology extensible?
7 . What is the ResourceBundle class in JSP?
8 . What is the difference between a Scrollbar and a ScrollPane in JSP?
9 . What is a Java package and how is it used?
10. What are the Object and Class classes used for?
11. What is a JSP and what is it used for?
12. What is difference between custom JSP tags and beans?
13. What are the two kinds of comments in JSP and what's the difference between them?
14. Can we use the constructor, instead of init(), to initialize servlet?
16. How many messaging models do JMS provide for and what are they?
17. How to Retrieve Warnings?
18. How many JSP scripting elements are there and what are they?
19. In the Servlet 2.4 specification SingleThreadModel has been deprecated, why?
20. What are stored procedures? How is it useful?
21. How do I include static files within a JSP page?
22. Why does JComponent have add() and remove() methods but Component does not?
23. How can I enable session tracking for JSP pages if the browser has disabled cookies?
24. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
25. How do you restrict page errors display in the JSP page?

What is servlet context ? | Java Servlets

The servlet context is an object that contains a servlet's view of the Web application within which the servlet is running. Using the context, a servlet can log events, obtain URL references to resources, and set and store attributes that other servlets in the context can use. (answer supplied by Sun's tutorial).

What is Java Servlet session? | Java Servlets

The session is an object used by a servlet to track a user's interaction with a Web application across multiple HTTP requests.

What is servlet mapping? | Java Servlets


The servlet mapping defines an association between a URL pattern and a servlet. The mapping is used to map requests to servlets.

Difference between GET and POST in Java Servlets? | Java Servlets

In GET your entire form submission can be encapsulated in one URL, like a hyperlink. query length is limited to 260 characters, not secure, faster, quick and easy.
In POST Your name/value pairs inside the body of the HTTP request, which makes for a cleaner URL and imposes no size limitations on the form's output. It is used to send a chunk of data to the server to be processed, more versatile, most secure.