WCD1题库Word下载.docx

上传人:b****1 文档编号:5167630 上传时间:2023-05-04 格式:DOCX 页数:21 大小:20.14KB
下载 相关 举报
WCD1题库Word下载.docx_第1页
第1页 / 共21页
WCD1题库Word下载.docx_第2页
第2页 / 共21页
WCD1题库Word下载.docx_第3页
第3页 / 共21页
WCD1题库Word下载.docx_第4页
第4页 / 共21页
WCD1题库Word下载.docx_第5页
第5页 / 共21页
WCD1题库Word下载.docx_第6页
第6页 / 共21页
WCD1题库Word下载.docx_第7页
第7页 / 共21页
WCD1题库Word下载.docx_第8页
第8页 / 共21页
WCD1题库Word下载.docx_第9页
第9页 / 共21页
WCD1题库Word下载.docx_第10页
第10页 / 共21页
WCD1题库Word下载.docx_第11页
第11页 / 共21页
WCD1题库Word下载.docx_第12页
第12页 / 共21页
WCD1题库Word下载.docx_第13页
第13页 / 共21页
WCD1题库Word下载.docx_第14页
第14页 / 共21页
WCD1题库Word下载.docx_第15页
第15页 / 共21页
WCD1题库Word下载.docx_第16页
第16页 / 共21页
WCD1题库Word下载.docx_第17页
第17页 / 共21页
WCD1题库Word下载.docx_第18页
第18页 / 共21页
WCD1题库Word下载.docx_第19页
第19页 / 共21页
WCD1题库Word下载.docx_第20页
第20页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

WCD1题库Word下载.docx

《WCD1题库Word下载.docx》由会员分享,可在线阅读,更多相关《WCD1题库Word下载.docx(21页珍藏版)》请在冰点文库上搜索。

WCD1题库Word下载.docx

B.Viewelement

C.Controllerelement

D.Acombinationoftheseelements

4.Mandyneedstodesignawebapplicationforhisorganization.HedecidestousetheservletinthewebapplicationtorespondtoanHTTPrequestfromtheclient.Hefirstcreatesaform,create_form.do,toacceptinputfromtheuser.Heneedstomakesurethatwhentheuserselectsthesubmitbuttonontheform,thedatatobesenttoserveriscontainedinthebodyoftheHTTPrequest.Whichofthefollowingcodeshouldheuseintheformtoaccomplishthistask?

A.<

formaction=’create_form.do’method=’POST’>

B.<

formaction=’create_form.do’method=’GET’>

C.<

formmethod=’create_form.do’action=’POST’>

D.<

formmethod=’create_form.do’action=’GET’>

5Mandyneedstodesignawebapplicationforhisorganization.HedecidestousetheservletinthewebapplicationtorespondtoanHTTPrequestfromtheclient.Hefirstcreatesaform,create_form.do,toacceptinputfromtheuser.Heneedstomakesurethatwhentheuserselectsthesubmitbuttonontheform,thedatatobesenttoserveriscontainedintheURLoftheHTTPrequest.Whichofthefollowingcodeshouldheuseintheformtoaccomplishthistask?

formaction='

create_form.do'

method='

POST'

>

GET'

formmethod='

action='

6WhichofthefollowingHTTPmethodsisreservedforusewithaproxythatcanswitchtobeingatunnel?

A.HEAD

B.OPTIONS

C.TRACE

D.CONNECT

7WhichofthefollowingHTTPmethodsrequestfortheservertostoretheentityenclosedinthebodyoftheHTTPmessage?

D.PUT

8Youareworkingonanapplicationthathasmultiplecomponents.Thecontrolneedstransferredfromonecomponenttoanothercomponent.Theinvokingcomponentshouldnotbeabletoproduceanyoutputofitsown.WhichmethodfromtheRequestDispatcherinterfacecanbeusedtoperformthetask?

A.request

B.include

C.response

D.forward

9Considerthefollowingcodesnippet:

CodeforUserInterface:

<

html>

head>

/head>

body>

formmethod=“post”action=”/Servlet/validate”>

Login:

inputtype=”text”name=”t1”>

Password:

inputtype=”text”name=”t2”>

inputtype=“submit”value=“Submit”>

/form>

/body>

/html>

CodeforServlet:

importjavax.servlet.*;

importjavax.servlet.http.*;

importjava.io.*;

publicclassvalidateextendsHttpServlet

{

publicvoiddoPost(HttpServletRequestreq,HttpServletResponseres)

ThrowsServletException,IOException

res.setContentType(“text/html”);

PrintWriterout=res.getAWriter();

Stringz1=req.getParameter(“t1”);

Stringz2=req.getParameter(“t2”);

out.println(“<

”);

if(z1.equals(“User1”))

if(z2.equals(“password”))

{

out.println(“Welcometothewebsite”);

}

else

out.println(“InvalidPssword”);

out.println(“NoSuchuser”);

}

Whatwillbetheoutputoftheabovecode,ifusernameasUSER1andPasswordaspassword?

A.Welcometothewebsite.

B.InvalidPassword.

C.NosuchUser.

D.Thecodewillnotcompilesuccessfully.

10Whichofthefollowingistheruntimerepresentationofthewebapplication?

A.init

B.service

C.ServletContext

D.Servlet

11WhichofthefollowingisissuedauniquerequestandresponseobjectbythewebcontainerforeachHTTPrequestmappedtoagivenservlet?

12.YouhavecreatedtheAddLeagueFormservletthatincludesasingleinitializationparametercalledseasons-listwiththevalueSpring,Summer,Autumn,Winter.Thisconfigurationobjectispassedtotheservletinstancebywayoftheinitmethod,whichissentbythewebcontainer.Howwillyouwritethecodeintheweb.xmlfiletoinitializetheseasons-listparameterwiththerequiredvalues?

servlet>

<

servlet-name>

AddLeagueForm<

/servlet-name>

servlet-class>

sl314.view.AddLeagueFormServlet<

/servlet-class>

param-name>

season-list<

/param-name>

param-value>

Spring,Summer,Autumn,Winter<

/param-value>

/init-param>

/servlet>

classes.sl314.view.AddLeagueFormServlet<

init-param>

13.You,beingasoftwaredeveloper,needstodevelopawebapplicationforyourorganization.Youdecidedtouseservletstocreatethewebapplication.Youcreatedaform,AddEmpFormServlet.javatoaddthedetailsofthenewemployeesandcompiledit.Theclassfileisstoredunderthe/WEB-INF/classes/viewdirectory.Thedeploymentdescriptorfile,web.xml,storesthedefinitionoftheservlet,AddEmpFormServlet.Whatcodeshouldbewrittenintheweb.xmlfiletodefineAddEnpFormServletinit?

AddEmpForm<

view.AddEmpFormServlet<

AddEmpFormServlet<

14.Youarecreatingawebapplicationusingservlets.Theapplicationrequiresthatapplication-specificdataissharedacrossindependentwebcomponents.Whichobjectcanbeusedtoimplementthis?

A.Servlet

B.ServletConfig

D.ServletContextListener

14Youarecreatingawebapplicationusingservlets.Youneedtoensurethatsharedapplicationdatamustbein-memorybeforeanyHTTPrequestsareexecutedonthewebapplication.Whichobjectcanbeusedtoperformthisinitialization?

15JamesisdevelopingawebapplicationusingStrutsframework.Forthis,heneedstoconfigurealloftheapplication-specificclassesinthestruts-config.xmlfile.Whichofthefollowingtaginthisfileconfiguresthesetofviewmappingbetweenthesymbolicnameoftheviewtothelogicalpathtotheview?

A.action-mappings

B.forword

C.action

D.struts-config

15WhiledevelopingawebapplicationusingStruts,youneedtocreateaStructscontroller.Forthis,youarerequiredtoextendtheStrutsActionbaseandimplementtheexecutemethod.WhichofthefollowingisthesecondargumentoftheexecutemethodandissuppliedbyStruts?

A.ActionMapping

B.ActionForword

C.ActionForm

D.Action

15WhiledevelopingawebapplicationusingStruts,youneedtocreateaStructscontroller.Forthis,youarerequiredtoextendtheStrutsActionbaseandimplementtheexecutemethod.Whichofthefollowingisthesecondargumentoftheexecutemethodandissuppliedbythewebcontainer?

C.HttpServletRequest

D.HttpServletResponse

16Whichofthefollowingtagisusedtospecifytheinitializationparametersintheweb.xmlfile?

A.init-param

B.servlet

C.servlet-mapping

D.url-pattern

17WhichofthefollowingtagisNOTapartoftheweb.xmlfile?

A.servlet

B.action

C.param-name

D.param-value

18WhiledevelopingawebapplicationusingStruts,youconfiguredStrutsActionServletintheweb.xmldeploymentdescriptor.TheActionServletusesaninitializationparameter,calledconfig,tospecifythepathtotheStrutsconfigurationfile.Forthis,thefollowingcodeintheweb.xmlfile:

/WEB-INF/struts-config.xml<

However,thereanerrorinthecode,Identifytheerrorandprovidethecorrectcode?

config<

/WEB-INF<

19.WhiledevelopingawebapplicationusingStruts,youarerequiredtoconfiguretheStrutsconfigurationfile,struts-config.xml.Youhavetodeclaretwoforwardentries,successanderrorwithinthe/admin/add_leagueaction.Forthispurpose,thefollowingcodeinthestruts-config.xmlfile:

action-mappings>

actionpath=”/admin/add_league”type=”s1314.contorller.AddLeagueAction”>

forwardname=”error”path=”/admin/add_league.view”/>

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 商务科技

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2