Which method is used to store file in the server ?
A GET
B PUT
C POST
D HEAD
Answer
B
When a user clicks on a link in a page, which method will get invoked ?
A POST
B PUT
C GET
D HEAD
Answer
C
What method will get executed on clicking the following code.?
<form method="GET" action="/TestServlet">
<input type="text" name="name">
<input type="submit" value="Submit">
</form>
A GET
B POST
C HEAD
D PUT
Answer
A
Which character is used to separate the URI and query string ?
A ?
B &
C =
D ;
Answer
A
What will be the output of the following code? Assume that all the variables are declared properly
String str= request.getDateHeader("Accept-Language");
out.println(str);
A Compiler error
B An IO Exception is thrown
C Null
D An IllegalArgumentException thrown
Answer
D
To send binary output to response, which method of HttpServletResponse is used to get the Writer/ Stream object ?
A getStream
B getWriter
C getBinaryOutputStream
D getOutputStream
E getBinaryStream
Answer
D
<%@ page language ="java" session="false" isErrorPage="false" %>
which of the following JSP implicit object will not be available to the JSP page ? Select two
A session
B request
C application
D exception
Answer
A and D
Which among the following will compile ?
A <% int x=10 %>
B <%= "hello how are you" %>
C <%= "hello" ;% >
D <%! int x=10 %>
Answer
B
In a JSP custom tag , which method would you use to access JSP implicit variable that references application scope ?
A PageContext.getOut()
B jspFactory.getPageContext()
C TagSupport.getValue(String)
D pageContext.getServletContext()
Answer
D
Which method is used to retrieve objects from session?
A getAttribute method of javax.servlet.ServletSession.
B getAtrribute method of javax.servlet.HttpSession
C getAttribute method of javax.servlet.http.Session
D getAttribute method of javax.servlet.http.HttpSession
E getAttribute method of javax.servlet.HttpSession
Answer
D