The largest Interview Solution Library on the web


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

41.What is (jsp:getProperty) action?

The getProperty action is used to retrieve the value of a given property and converts it to a string, and finally inserts it into the output.

42.What is (jsp:forward) Action?

The forward action terminates the action of the current page and forwards the request to another resource such as a static page, another JSP page, or a Java Servlet.
The simple syntax of this action is as follows:

43.What is (jsp:plugin) Action?

The plugin action is used to insert Java components into a JSP page. It determines the type of browser and inserts the or tags as needed. If the needed plugin is not present, it downloads the plugin and then executes the Java component. The Java component can be either an Applet or a JavaBean.

44.What are the different scope values for the JSP action?

The scope attribute identifies the lifecycle of the Action element. It has four possible values: a page, brequest, csession, and d application.

45.What are JSP implicit objects?

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.

46.What implicit objects are supported by JSP?

request,response,out,session,application,config,pageContext,page, Exception

47.What is a request object?

The request object is an instance of a javax.servlet.http.HttpServletRequest object. Each time a client requests a page the JSP engine creates a new object to represent that request.
The request object provides methods to get HTTP header information including form data, cookies, HTTP methods etc.

48.How can you read a request header information?

Using getHeaderNames method of HttpServletRequest to read the HTTP header infromation. This method returns an Enumeration that contains the header information associated with the current HTTP request.

49.What is a response object?

The response object is an instance of a javax.servlet.http.HttpServletRequest object. Just as the server creates the request object, it also creates an object to represent the response to the client.
The response object also defines the interfaces that deal with creating new HTTP headers. Through this object the JSP programmer can add new cookies or date stamps, HTTP status codes etc.

50.What is the out implicit object?

The out implicit object is an instance of a javax.servlet.jsp.JspWriter object and is used to send content in a response.

51.What is the difference between JspWriter and PrintWriter?

The JspWriter object contains most of the same methods as the java.io.PrintWriter class. However, JspWriter has some additional methods designed to deal with buffering. Unlike the PrintWriter object, JspWriter throws IOExceptions.

52.What is the session Object?

The session object is an instance of javax.servlet.http.HttpSession and is used to track client session between client requests

53.What is an application Object?

The application object is direct wrapper around the ServletContext object for the generated Servlet and in reality an instance of a javax.servlet.ServletContext object.
This object is a representation of the JSP page through its entire lifecycle. This object is created when the JSP page is initialized and will be removed when the JSP page is removed by the jspDestroy method.

54.What is a config Object?

The config object is an instantiation of javax.servlet.ServletConfig and is a direct wrapper around the ServletConfig object for the generated servlet.
This object allows the JSP programmer access to the Servlet or JSP engine initialization parameters such as the paths or file locations etc.

55.What is a pageContext Object?

The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page.
This object stores references to the request and response objects for each request. The application, config, session, and out objects are derived by accessing attributes of this object.
The pageContext object also contains information about the directives issued to the JSP page, including the buffering information, the errorPageURL, and page scope.

56.What is a page object?

This object is an actual reference to the instance of the page. It can be thought of as an object that represents the entire JSP page.
The page object is really a direct synonym for the this object.

57.What is an exception Object?

The exception object is a wrapper containing the exception thrown from the previous page. It is typically used to generate an appropriate response to the error condition.

58.What is difference between GET and POST method in HTTP protocol?

The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the Character. The POST method packages the information in exactly the same way as GET methods, but instead of sending it as a text string after a in the URL it sends it as a separate message. This message comes to the backend program in the form of the standard input which you can parse and use for your processing.

59.How to read form data using JSP?

JSP handles form data parsing automatically using the following methods depending on the situation:

  • getParameter: You call request.getParameter method to get the value of a form parameter.
  • getParameterValues: Call this method if the parameter appears more than once and returns multiple values, for example checkbox.
  • getParameterNames: Call this method if you want a complete list of all parameters in the current request.
  • getInputStream: Call this method to read binary data stream coming from the client.

60.What are filters?

JSP Filters are Java classes that can be used in JSP Programming for the following purposes:

  • To intercept requests from a client before they access a resource at back end.
  • To intercept requests from a client before they access a resource at back end.
  • To manipulate responses from server before they are sent back to the client.

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


copyright © 2014 - all rights riserved by javatechnologycenter.com