-
-
-
-
-
Which of the following statements is true regarding the scope of the ‘session’ in JSP? (Multiple choice)
Skill/Topic: JSP Life CycleA) Objects with session scope are accessible from pages processing requests that are in the same session as the one in which they were created.B) It is not legal to define an object with session scope from within a page that is not session-aware.C) All references to the object shall be released after the associated session ends.D) References to objects with session scope...
-
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);%>
-
-
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
-
-
-
Which of the following statements are trueI cookie.setMaxAge(0) – delete the cookieII cookie.setMaxAge(1) –the cookie will live before it expiresIII cookie.setMaxAge(-1) – the cookie will not be stored beyond this session.
Skill/Topic: JSP Life CycleA) I onlyB) II, III onlyC) I, II onlyD) I, II, III
-
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.
-
Which of the tag is used to show the comments in the JSP page
Skill/Topic: Programming ConstructsA) B) C) D)
-
Which of the tag contains a code fragment valid in the page scripting language.
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
-
Which codeline must be set before any of the lines that use the PrintWriter
Skill/Topic: Programming ConstructsA) setContentWriter() B) setWriter()C) setPrintType()D) setContentType()
-
We can restrict the calling of the errorPage in the JSP by setting the value true for the ______ param in the ErrorPage attribute of the Page Directory
Skill/Topic: Programming ConstructsA) isErrorpage
-
State true or false - We make use of a ServletOutputStream object from the JSP page
Skill/Topic: Programming ConstructsA) TrueB) FalseExplanation: use the JSPWriter object
-
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
-
When u try to redirect a page after you already have written something in your page, the error encountered is “Response has already been committed error” or popularly called 402 error.
Skill/Topic: Programming ConstructsA) FalseB) True
JSP Interview Questions
Ans