-
What is the difference between ServletContext and ServletConfig?
Both are interfaces. The servlet engine implements the ServletConfig interface in order to pass configuration information to a servlet. The server passes an object that implements the ServletConfig interface to the servlet's init() method.The ServletContext interface provides information to servlets regarding the environment in which they are running. It also provides standard way for servlets to write...
-
How can I set a cookie and delete a cookie from within a JSP page?
A cookie, mycookie, can be deleted using the following scriptlet:<%//creating a cookieCookie mycookie = new Cookie("aName","aValue");response.addCookie(mycookie);//delete a cookieCookie killMyCookie = new Cookie("mycookie", null);killMyCookie.setMaxAge(0);killMyCookie.setPath("/");response.addCookie(killMyCookie);%>
-
How do you prevent the Creation of a Session in a JSP Page and why?
By default, a JSP page will automatically create a session for the request if one does not exist. However, sessions consume resources and if it is not necessary to maintain a session, one should not be created. For example, a marketing campaign may suggest the reader visit a web page for more information. If it is anticipated that a lot of traffic will hit that page, you may want to optimize the load...
-
What is the difference between GenericServlet and HttpServlet?
GenericServlet is for servlets that might not use HTTP, like for instance FTP service.As of only Http is implemented completely in HttpServlet. The GenericServlet has a service() method that gets called when a client request is made. This means that it gets called by both incoming requests and the HTTP requests are given to the servlet as they are.[qu]What are the differences between GET and POST service...
-
-
-
-
-
What is datacatching in jsp
It can store in catch and move one page to another page
-
-
-
-
-
Which of the tag is used to show the comments in the JSP page
Skill/Topic: Programming ConstructsA) B) C) D)
-
The ________________________ when added to the user session tells us that the session timed out.
Skill/Topic: Programming ConstructsA) SessionTotalTimeOutIndicator B) SessionTotalTimedoutIndicator C) SessionTimeoutIndicator D) SessionTimedoutIndicator
-
Adding a meta, usage like <meta name=”alok” contents=”no index”> tag to the jsp prevents it from being indexed by the search engines like Yahoo and Google
Skill/Topic: Programming ConstructsA) TrueB) False
-
The error message displayed when the page is not found at the correct location.
Skill/Topic: Programming ConstructsA) 550 B) 440 C) 505 D) 404
-
Which of the following statements is true about JSP tag library?
Skill/Topic: Programming ConstructsA) It defines the standard tag that works the same everywhere B) It is a single library and we can use it in multiple jsp containers C) It has support for the common structural tasks like iteration and condition. D) All of the above
-
Which of the following are the JSP scripting elements (Multiple choice)
Skill/Topic: Programming ConstructsA) Declarations B) Scriptlets C) expressions D) None of the above
-
State true or false -- While using request.getRequestDispatcher(path) we need to give the absolute path of the object
Skill/Topic: Programming ConstructsA) TrueB) FalseExplanation: request.getRequestDispatcher(path): In order to create it we need to give the relative path of the resource, context.getRequestDispatcher(path): In order to create it we need to give the absolute path of the resource.
JSP Interview Questions
Ans