Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

J2EE QUESTIONS : PART 3

What is a Hidden Comment in JSP?

<%– –%>

 <%– %>

</ %---- % / >

<% -----/ %>

SHOW ANSWER

What is a Expression in JSP?

<%= %>

<% %>

</ %  % / >

<% + %>

 

SHOW ANSWER

Given following form:

<form action=”register.do”>
<input type=”text” name=”Name”>
<input type=”submit” value=”Save”>
</form>

and a servlet code:

public class RegisterServlet extends HttpServlet{
pulic void doPost(HttpServletRequest req, HttpServletResponse res) {
// registration logic goes here
return;
}
}

With the above code, assuming the servlet is configured properly and registration logic works good, trying to register user fails.
Choose one reason.

The registration fails because, above servlet dont have doGet() method.

The registration fails because, above servlet dont have service() method.

The registration fails because, above servlet  have doPost() method.

 The registration fails because, above servlet  have return.

SHOW ANSWER

PageContext is an implicit object in jsp.

True

False

SHOW ANSWER

JavaServer Pages are processed by  Software on the ?

JSP Container

Server

Client

Driver Manager

SHOW ANSWER

A JSP is transformed into an ……?

Java applet

Java servlet

Either 1 or 2 above

Neither 1 nor 2 above

SHOW ANSWER

The Java __________ specification defines an application programming interface for communication between the Web server and the application program?

Servlet

Server

Program

Randomize

SHOW ANSWER

What are Servlets?

Java Servlets are programs that run on a Web or Application server.
 Java Servlets act as a middle layer between a request coming from a Web browser or other HTTP client and databases or applications on the HTTP server.
Both of the above.
None of the above.
SHOW ANSWER

Which of the following code is used to get session id of a HTTP Session object in servlets?

session.getSessionId()
session.getId()
 session.getActiveId()
 None of the above.
SHOW ANSWER

Which of the following code is used to get country/region name in servlets?

request.getDisplayCountry()
Locale.getDisplayCountry()
 response.getDisplayCountry()
 None of the above.
SHOW ANSWER

___________ is a block of java code in JSP that is used define class-wide variables and methods in the generated class file?

scriplets 
 declarations
 element
Expression
SHOW ANSWER

__________ provides the ability to directly insert java into an HTML document?

declarations 
scriptlets 
 directives
 none of  the above
SHOW ANSWER

Name the class that includes the getSession method that is used to get the HttpSession object?

HttpServletRequest 
HttpServletResponse
 SessionContext
  SessionConfig
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in