JSP SERVLET ASSESSMENT
一.QUESTIONS:
One:
In jsp,we have defined String text as below.
String str=”abc”;
Which of the following Jsp code can show the text on page?
A.<%str%>
B.<%out.print(str);%>
C.<%abc%>
D.<%out.print(str)%>
Two:
Which of the following jsp code will redirect the browser of "chinasofti" Home Page?
A.response.forward("http://www.chinasofti.com");
B.page.forward("http://www.chinasofti.com");
C.response.sendRedirect("http://www.chinasofti.com");
D.page.sendRedirect("http://www.chinasofti.com");
Three:
What of the following is NOT correct about the difference between forward and redirect in Java
Servlet API
A.forward will not change the URL displayed in the browser window,while redirect will.
B.In both case of forward and redirect ,server sends the new URL to browser to open it
C.Forward does not trigger the browser to submit the request again,while redirect will.
D.Forward is happen in server side while redirect happen in client slide.
Four:
Which of the following statement is "dynamic-include-jsp"?
A.<jsp:include file="top.jsp"/>
B.<%@ include file="top.jsp"%>
C.<jsp:include page="top.jsp">
D.<%@include page="top.jsp"%>
Five:
Which of the following xml tags represent a servlet class
A.<servlet-class>com.hsbc.etc.servlet.UserServlet</servlet-class>