Write the following code for a JSP page:<%@ page language = "java" %> <%PrintWriter print = request.getWriter();print.println("Welcome");>%Suppose you access this JSP file, Find out your answer.a) A blank page will be displayed.b) A page with the text Welcome is displayedc) An exception will be thrown because the implicit out object is not usedd) An exception will be thrown because PrintWriter can be used in servlets only

A page with the text Welcome is displayed

Questions by abhinav_saraswat

Showing Answers 1 - 9 of 9 Answers

Arvind Kumar

  • Mar 26th, 2007
 

option d) is true.

  Was this answer useful?  Yes

spring

  • Apr 6th, 2009
 

This code will print "Welcome"

request does't have any getWriter() defined, only response has.

<%@ page language = "java" %>


<%
java.io.PrintWriter print = response.getWriter();
print.println("Welcome");
%>

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions