Documente Academic
Documente Profesional
Documente Cultură
1, <servlet>
<servlet-
name>AddLeagueForm</servl
et-name>
<servlet-
class>sl314.view.AddLeagueF
ormServlet</servlet-class>
<param-name>seasons-
You have created the AddLeagueForm servlet list</param-name>
that includes a single initialization parameter <param-
called seasons-list with the value Spring, value>Spring,Summer,Autumn
Summer, Autumn, Winter. This configuration ,Winter</param-value>
object is passed to the servlet instance by way of </init-param>
JMT1054 the init method, which is s </servlet> m
The life cycle of the servlet involves loading the
servlet class and then creating the servlet
instance. What will the third step of the servlet life 1, Calling the service method
JMT1055 cycle? m m
The life cycle of the servlet involves loading the
servlet class, creating the servlet instance and
then initializing the servlet component. What will 1, Calling the service method
JMT1056 the next step of the servlet life cycle? m m
1, <servlet>
<servlet-
name>AddEmpForm</servlet-
You, being a software developer, needs to name>
develop a web application for your organization. <servlet-
You decided to use servlets to create the web class>view.AddEmpFormServl
application. You created a form, et</servlet-class>
AddEmpFormServlet.java to add the details of the </servlet>
JMT1060 new employees and complied it. The c m
Which of the following methods is used to store
the context-scoped attributes in the
JMT1061 ServletContext object? m 1, init(ServletConfig) m
1,
While developing a web application using Struts, <name>FrontController<name
you are required to configure the Struts >
ActionServlet in the web.xml deployment <servlet-class>
descriptor. The ActionServlet is given the name org.apache.struts.action
FrontController. To define the FrontController </servlet-class>
JMT1067 servlet, the following code i m
1, <action-mappings>
<action path="/add_dvd"
type="com.dvd.controller.AddD
While developing a web application using Struts, VDAction">
you are required to configure the Struts <forward name="error"
configuration file, struts-config.xml. You have to path="/add_dvd.view"/>
declare two forward entries, success and error </action>
within the /add_dvd action. For this purpose, the </action-mappings>
JMT1069 following code i m
1, <action-mappings>
<action
path="/admin/add_league"
type="sl314.controller.AddLea
gueAction">
<forward name="success"
While developing a web application using Struts, path="/admin/success.view"/>
you are required to configure the Struts <forward name="error"
configuration file, struts-config.xml. You have to path="/admin/add_league.view
declare two forward entries, success and error "/>
within the /admin/add_league action. For this </action>
JMT1070 purpose, the followi </action-mappings> m
James is developing a web application using
Struts framework. For this, he needs to configure
the Struts ActionServlet in a file. Which of the
following files is used to configure the Struts
JMT1071 infrastructure controller? m 1, web.xml m
James is developing a web application using
Struts framework. For this, he needs to configure
all of the application-specific classes in a file.
Which of the following files is used to configure
JMT1072 the action mappings? m 1, web.xml m
<servlet-mapping>
<servlet-name>MyController</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
1)<filter-mapping>
<filter-name>First</filter-name> 1,First>Second>Third>Fourth
JMT1092 <servl m
1,String
login=request.getParameter("l
ogin");
if(login.equals("tim")
{
return
Stem text : Consider the following code regarding mapping.Forward("error");
accessing of session attributes in a session }
management program. But this program has few if(login.equals("David")
errors. Predict the correct code for the program. {
return
String login=request.getParameterValue("login"); mapping.Forward("success");
JMT1094 if(login.equals }m
Stem text : You have deployed two servlets
named servlet1 and servlet2 in your Web server.
You want to create an attribute called 1,ServletContext
"customernumber" and assign the value of a c=getServletContext();
variable cnum to it. Which of the following is the c.setAttribute(cnum,"customer
JMT1095 correct method for doing it? m number"); m
1,<resource-ref>
<description>
Stem text : Consider the following lines of code in </description>
web.xml file regarding defining of DataSource <res-ref-
reference: name>jdbc/myDB</res-ref-
name>
<resource-ref> <res-
<description> type>javax.sql.DataSource</re
</description> s-type>
<res-refname>jdbc/myDB<resref-name> <res-auth>container</res-
<res-type>java.sql.DataSource</res-type> auth>
JMT1105 <res-auth>container<res </resource-ref> m
<font color='green'>
<ul>
<c:foreach flag=errmsg items="${errorMsgs}"> 1,<font color='green'>
<li>$errmsg</li> <ul>
</c:forEach> <c:forEach var=errmsg
</ul> items="${errorMsgs}">
</font> <li>$errmsg</li>
</c:forEach>
The code snippet contains some errors Predict </ul>
JMT1116 the corre </font> m
Stem text : Consider following statements for
Expression Tag in JSP.
1,<jsp:useBean id="login"
scope="Session"
Stem text : Consider the following code snippet of class="s1314.beans.LoginBea
JSP Bean that contains few errors. Predict the n">
Correct Code. <%
login.setValue(request.getPara
<jsp:usebean identity="login" scope="Session" meter("Loginid"));
class=s1314.beans.LoginBean> login.setAddress(request.getP
<%! arameter("address"));
login.setValue(request.getParameter("Loginid")); %>
JMT1119 login.setAddre </jsp:useBean> m
1,<jsp-config>
<jsp-property-group>
<url-
pattern>/scriptting_off/*</url-
pattern>
<scripting-
invalid>true</scripting-invalid>
</jsp-property-group>
<jsp-property-group>
<url-pattern>/EL_off/*</url-
While configuring the JSP Environment you want pattern>
to turn off scripting as well as ignore EL in jsp file. <el_ignored>true</el_ignored>
JMT1120 What would be the code for this? m </jsp-property-group
Stem text : Which of the following lines of code 1,<jsp:plugin type="applet"
can be used for adding a pre-defined applet code="chatApp.class"
named chatApp to a JSP page? codebase="/applets"
The chatApp class file is present in the /applets width="400" height = "300">
JMT1121 directory. m </jsp:plugin> m
1,<html>
<% exception.getMessage()
%>
<body text = "green">
<%@ page
isErrorPage="true">
The following error has been
Which of the following lines of code represents a generated: <%=
JSP error page that displays the error message in exception.getMessage() %>
JMT1122 green color? m </body></html> m
1,import
org.apache.struts.action.Action
Form;
public class employeeform
implements ActionForm
{
Predict the correct code for declaration of a form //required code
JMT1136 bean called employeeform in struts framework? m } m
Harry wants to create a form bean in struts
framework. He wants to perform certain validation
for that form bean. Which class he should use to
create a form bean and which method he should
use to perform the validations for the form bean? 1,ActionForm Class &
JMT1137 m doValidate() method m
1,It is an authentication
technique of authenticating
users before allowing them to
access protected resources
and the server enforces
Which of the following is correct in reference to security through the Web
JMT1141 basic authentication technique? m browser. m
1,It is an authentication
technique of authenticating
Which of the following is correct in reference to users before allowing them to
JMT1142 digest authentication technique? m access protected resources. m
1,It secures Web applications
by maintaining a record of the
Which of the following is correct in reference to rights assigned to different
JMT1143 Auditing security technique? m types of Web users. m
3, Nonadaptive organizations
2, Simple organizations m m 4, Complex organizations m 2
2, Service-based organization
m 3, Complex organization m 4, Simple organization m 2
3, Manufacturing and
2, Sales and Marketing m Production m 4, Human Resource m 4
3, Manufacturing and
2, Finance and accounting m production m 4, Human resource m 2
4, Infrastructure development
2, Human resource m 3, IT support m m 1
2, Invoice and Order detail 3, Inventory and Order detail 4, Quotation and Inventory
database m database m database m 1
2, 3, 4,
response.setHeader("Cache- response.setHeader("Cache- response.setHeader("Cache-
Control", "no-cache"); m Control", "private"); m Control", "cache"); m 3
2, 3, 4,
response.setHeader("Cache- response.setHeader("Cache- response.setHeader("Cache-
Control", "no-cache"); m Control", "private"); m Control", "cache"); m 2
2,HttpServletRequest interface
m 3,ServletConfig class m 4,HttpServlet class m 2
2, By overriding the init method 3, By overriding the destroy 4, By overriding the doGet
in the servlet class. m method in the servlet class. m method in the servlet class. m 3
2, By overriding the init method 3, By overriding the destroy 4, By overriding the doGet
in the servlet class. m method in the servlet class. m method in the servlet class. m 2
3, <servlet>
<servlet-
2, <servlet> name>AddLeagueForm</servl 4, <servlet>
<servlet- et-name> <servlet-
name>AddLeagueForm</servl <servlet- name>AddLeagueForm</servl
et-name> class>sl314.view.AddLeagueF et-name>
<servlet- ormServlet</servlet-class> <servlet-
class>sl314.view.AddLeagueF <init-param> class>sl314.view.AddLeagueF
ormServlet</servlet-class> <param-name>seasons- ormServlet</servlet-class>
<param-name>seasons- list</param-name> <init-param>
list</param-name> <param- <param-
<param- value>Spring,Summer,Autumn value>Spring,Summer,Autumn
value>Spring,Summer,Autumn ,Winter</param-value> ,Winter</param-value>
,Winter</param-value> </init-param> </init-param>
</servlet> </servlet> </servlet>
m m m 3
2, <servlet- 4, <servlet-
name>FrontController</servlet 3, <servlet- name>FrontController<servlet-
-name> name>FrontController</servlet name>
<servlet-class> -name> <class>
org.apache.struts.action.Action <servlet-class> org.apache.struts.action.Action
Servlet struts.action.ActionServlet Servlet
</servlet-class> <servlet-class> <class>
m m m 2
2, <servlet-mapping> 3, <servlet-mapping>
<servlet- <servlet- 4, <servlet-mapping>
name>FrontController</servlet name>FrontController</servlet <servlet-
-name> -name> name>Action</servlet-name>
<url-pattern>.do<url-pattern> <url-pattern>*.do</url-pattern> <url-pattern>.do</url-pattern>
</servlet-mapping> </servlet-mapping> </servlet-mapping>
m m m 3
4, <action-mappings>
<action path="/add_dvd"
2, <action-mappings> type="com.dvd.controller.AddD
<action path="/add_dvd"> VDAction">
<forward <forward
name="success" 3, <action-mappings> name="success"
path="/success.view"/> <action path="/add_dvd" path="/success.view"/>
<forward name="error" type="com.dvd.controller.AddD <forward name="error"
path="/add_dvd.view"/> VDAction"> path="/add_dvd.view"/>
</action> </action> </action>
</action-mappings> </action-mappings> </action-mappings>
m m m 4
3, <action-mappings> 4, <action-mappings>
<action <action
2, <action-mappings> path="add_league" path="/add_league"
<action type="sl314.controller.AddLea type="sl314.controller.AddLea
path="/admin/add_league"> gueAction"> gueAction">
<forward name="success" <forward name="success" <forward name="success"
path="/admin/success.view"/> path="/admin/success.view"/> path="/admin/success.view">
<forward name="error" <forward name="error" <forward name="error"
path="/admin/add_league.view path="/admin/add_league.view path="/admin/add_league.view
"/> "/> ">
</action> </action> </action>
</action-mappings> m </action-mappings> m </action-mappings> m 1
2, list_leagues.do m 3, struts-config.xml m 4, form.do m 1
2,Statement A,B,D are true 3,Statement B,C,D are true 4,Statement A,B are true and
and Statement C is False. m and Statement A is False. m Statement C,D are False. m 2
4,<resorurce-ref>
2,<resorurce-ref> 3,<resorurce-ref> <res-ref-
<resname>jdbc/passworddb</r <res-ref- name>"jdbc/passworddb"<res-
esname> name>jdbc/passworddb<res- ref-name>
<res- ref-name> <res-
type>javax.sql.DataSource</re <respackage>javax.sql.DataS type>"javax.sql.DataSource"</
s-type> ource</respackage> res-type>
<res-auth>Container</res- <res-auth>Container</res- <res-auth>Container</res-
auth> auth> auth>
</resource-ref> m </resource-ref> m </resource-ref> m 1
4,<resource-ref>
2,<resource-ref> 3,<resource-ref> <description>
<description> <description> </description>
</description> </description> <res-ref-
<res-ref- <res-refname>jdbc/myDB<res- name>jdbc/myDB<res-ref-
name>jdbc/myDB<res-ref- refname> name>
name> <res- <res-
<res- type>javax.sql.DataSource<re type>javax.sql.DataSource</re
type>java.sql.DataSource<res- s-type> s-type>
type> <res-auth>container</res- <res-auth>container</res-
<res-auth>container<res-auth> auth> auth>
</resource-ref> m </resource-ref> m </resource-ref> m 1
2, url m 3, out m 4, if m 3
2,Statement A, D are true and 3,Statement A,B are true and 4,Statement B is False and A,
B, C are False. m C,D are False. m C, D are true. m 2
4,<jsp-config>
2,<jsp-property-group> <jsp-property-group>
<url- <url-pattern>scriptting_off</url-
pattern>/scriptting_off/*</url- 3,<jsp-config> pattern>
pattern> <url- <scripting-
<scripting- pattern>/scriptting_off/*</url- invalid>true</scripting-invalid>
invalid>true</scripting-invalid> pattern> </jsp-property-group>
</jsp-property-group> <scripting- <jsp-property-group>
<jsp-property-group> invalid>true</scripting-invalid> <url-pattern>EL_off</url-
<url-pattern>/EL_off/*</url- <url-pattern>/EL_off/*</url- pattern>
pattern> pattern> <el_ignored>true</el_ignored>
<el_ignored>true</el_ignored> <el_ignored>true</el_ignored> </jsp-property-group>
</jsp-property-group> m </jsp-config> m </js 1
2,<jsp:plugin type="applet" 3,<jsp:plugin type="applet" 4,<jsp:plugin
code="chatApp.class" code="chatApp.class" code="chatApp.class"
codebase="applets" codebase="/applets" codebase="/applets"
width="400" height = "300""> width="400" height = "300"> width="400" height = "300>
</jsp:plugin> m <jsp:plugin> m </jsp:plugin> m 1
3,<html> 4,<html>
2,<html> <body text = "green"> <body>
<body text = "green"> <%@ page <%@ page
<%@ page isErrorPage="true"%> isErrorPage="true">
isErrorPage="true"%> The following error has been The following error has been
The following error has been generated: <%= generated: <%=
generated: <%= exception.Message() %> exception.getMessage() %>
exception.getMessage() %> </body> </body>
</body></html> m </html> m </html> m 2
2,It will display the date and 3,It will display time as 4,It will display the current time
time. m hh/mm/ss. m as hh:mm:ss. m 4
2,It will display the date and 3, It will display the time as 4,It will display the current date
time in dd/yy/mm format. m dd/mm/yy format. m in yy/mm/dd format. m 4
2,Both login and password 3,Login Message will be 4,Both login and password
message will be displayed ten displayed nine times and message will be displayed nine
times. m Password message once. m times. m 1
2, validate m 3, findForward m 4, init m 2
2,import
org.apache.struts.action.Action 3,import 4,import
Form; org.apache.struts.ActionForm; org.apache.struts.action.Action
public class employeeform public class employeeform Form;
extends ActionForm extends ActionForm public class employeeform
{ { {
//required code //required code //required code
}m }m }m 2
2,Action Class & Validate() 3,ActionForm Class & 4,ActionForm Class &
method m validate() method m performValidations() method m 3
2,Statement A is False and 3,Statement A,B are true and 4,Statement A,B,D are true
B,C,D are true. m C,D are False. m and C is False. m 2
3,<%@ forward
2,<jsp: @page="/validate.jsp> page="/validate.jsp"> 4,<jsp: page="/Validate.jsp">
<jsp: param <jsp: param <jsp: param
name="param1" name="param1" name="param1"
value="Login"/> value="Login"/> value="Login"/>
</jsp:forward> m </jsp:forward> m </jsp:forward> m 1
3,It is an authentication
techniques where the
administrator specifies the
2,It is an authentication Web pages that are to be 4,It is an authentication
technique which creates a secured on a website and the technique in which the server
customized logon page for a users that have the access to authenticates a client by using
Web application. m these Web pages. m digital certificates. m 1
3,It is an authentication
techniques where the
administrator specifies the
Web pages that are to be
secured on a website and the
users that have the access to
2,It is an authentication these Web pages. Also the 4,It is an authentication
technique which creates a user information is encrypted technique in which the server
customized logon page for a before it is sent to the server. authenticates a client by using
Web application. m m digital certificates. m 3
2,It ensures that data is not 4,It specifies the rights
modified while being asssigned to an authenticated
transferred between the server 3,It is the process of identifying user to access resources of a
and the client. m a user. m Web application. m 1
4,<login-config>
2,<login-config> 3,<login-config> <auth-method>CLIENT-
<auth-method>FORM</auth- <auth-method>DIGEST</auth- CERT</auth-method>
method> method> <realm-
<realm-name>Secure Form <realm-name>Secure Digest name>Certificate</realm-
Authentication</realm-name> Authentication</realm-name> name>
</login-config> m </login-config> m </login-config> m 2
4,<login-config>
2,<login-config> 3,<login-config> <auth-method>CLIENT-
<auth-method>FORM</auth- <auth-method>DIGEST</auth- CERT</auth-method>
method> method> <realm-
<realm-name>Secure Form <realm-name>Secure Digest name>Certificate</realm-
Authentication</realm-name> Authentication</realm-name> name>
</login-config> m m </login-config> m 4
2,Step 1 --> Step 2 --> Step 3 3,Step 1 --> Step 3 --> Step 2 4,Step 1 --> Step 2 --> Step 3
--> Step 5 --> Step 4 --> Step 6 --> Step 4 --> Step 5 --> Step 6 --> Step 4 --> Step 5 --> Step 6
m m m 1
2,Step 1 --> Step 3 --> Step 2 3,Step 1 --> Step 3 --> Step 4 4,Step 1 --> Step 2 --> Step 4
--> Step 4 --> Step 5 m --> Step 2 --> Step 5 m --> Step 3 --> Step 5 m 2