Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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, <init-param>
<param-name>config</param-
While developing a web application using Struts, name>
you configured Struts ActionServlet in the <param-value>/WEB-
web.xml deployment descriptor. The ActionServlet INF/struts-config.xml</param-
uses an initialization value>
parameter, called config, to specify the path to the </init-param>
JMT1066 Struts configuration file. For this, 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="/admin/add_league"
type="sl314.controller.AddLeag
ueAction">
<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
A code for filter mapping has to be written for a 1,<filter-mapping>
filter called Login Filter for components in such a <filter-name>LoginFilter</filter-
manner that it should be applied to component name>
whenever an error occurs . <dispatcher>ERROR</dispatch
Predict the code for filter mapping to perform the er>
JMT1093 required task from the follo </filter-mapping> m
1,String
login=request.getParameter("lo
gin");
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
1,<resorurce-ref>
<res-ref-
name>jdbc/passworddb</res-
ref-name>
<res-
type>javax.sql.DataSource</re
s-type>
A Datasource reference for a datasource called <res-auth>Container</res-
passworddb has to be defined in a deployment auth>
JMT1102 descriptor file. What would be the code for this? m </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
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
Stem text : Consider the following code snippet:
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
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
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
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
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>Action</servlet-
name> name> 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.AddLeag type="sl314.controller.AddLeag
path="/admin/add_league"> ueAction"> ueAction">
<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
3,String 4,String
2,String login=request.getParameterVal login=request.getParameter("lo
login=request.getParameter("lo ue("login"); gin");
gin"); if(login.equals("tim") if(login.equals("tim")
if(login.equals("tim") { {
{ return return
return mapping.findForward("error"); mapping.findForward("error");
mapping.findForward(error); } }
} if(login.equals("David") if(login.equals("David")
if(login.equals("David") { {
{ return return
return mapping.findForward("success mapping.findForward("success
mapping.findForward(success); "); ");
}m }m }m 4
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.DataSo type>"javax.sql.DataSource"</r
s-type> urce</respackage> es-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,Statement A and D are true. 3,Statement B,C, and D are 4,Statement A,B, and D are
m true. m true. m 4
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
2,<jsp:useBean identity="login" 3,jsp:useBean id="login" 4,jsp:useBean id="login"
scope="Session" scope="Session" scope="Session"
class="s1314.beans.LoginBea class="s1314.beans.LoginBea class="s1314.beans.LoginBea
n"> n"> n">
<%! <%! <%
login.setValue(request.getPara login.setValue(request.getPara login.setValue(request.getPara
meter("Loginid")); meter("Loginid")); meter("Loginid"));
login.setAddress(request.getPa login.setAddress(request.getPa login.setAddress(request.getPa
rameter("address")); rameter("address")); rameter("address"));
%> %> %>
<jsp:useBean> m </jsp:useBean> m <jsp:useBean> m 1
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,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,<%@ include 3,<jsp:forward 4,<%@ page
file="Header.html" %> m page="Header.html"> m import="Header.html" %> m 2
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 Web
2,It is an authentication pages that are to be secured 4,It is an authentication
technique which creates a on a website and the users that technique in which the server
customized logon page for a have the access to these Web authenticates a client by using
Web application. m 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
2,It is an authentication have the access to these Web 4,It is an authentication
technique which creates a pages. Also the user technique in which the server
customized logon page for a information is encrypted before authenticates a client by using
Web application. m it is sent to the server. m digital certificates. m 3
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