×ÊÁϽö¹©²Î¿¼
DataSource ds = (DataSource)
ctx.lookup(\Connection conn = ds.getConnection( ); D. Context ctx = new InitalContext ( ); DataSource
ds
=
(DataSource)
ctx.lookup(\
Connection conn = ds.getConnection( );
18) ÔÚJava EEÖУ¬ÔÚweb.xmlÖÐÓÐÈçÏ´úÂë¶Î£º
ÆäÖУ¬Ê¡ÂԺűíʾʡÂÔÁËһЩ´úÂë¡£ÔÚServletÖУ¨ £©°Ñ³õʼ»¯²ÎÊýlistOrdersµÄÖµ£ºcom.mycompany.myactions.ListOrdersActionÈ¡³öÀ´¡£
A. ʹB. ʹC. ʹ
ÓÃÓÃÓÃ
ServletServletContextServletConfig
µÄµÄµÄ
getInitParameter(\·½·¨ getInitParameter(\·½·¨ getInitParameter(\·½·¨
×ÊÁϽö¹©²Î¿¼
D. ʹÓÃServletRequestµÄ
getInitParameter(\·½·¨ 19) ÏÂÃæ¹ØÓÚJavaÖлỰ¸ú×ÙµÄ˵·¨´íÎóµÄÊÇ£¨ £©¡£
A. HTTPÐÒéÊÇÎÞ״̬µÄ£¬Òò´Ë·þÎñÆ÷ÐèÒªÓûỰ¸ú×Ù¼¼ÊõÀ´·Ö±æÿ¸ö¿Í»§
B. ·þÎñÆ÷Ϊÿ¸ö»á»°·ÖÅäÁËÒ»¸öID×÷ΪΨһ±êʶ
C. sessionÓÉ¿Í»§¶Ë´´Á¢£¬ÎÒÃÇÔÙÓÃrequest.getSession()À´»ñµÃHttpSession¶ÔÏó
D. ʹÓûỰ¸ú×ÙÄܹ»ÊµÏÖÖîÈçÓû§µÇ¼ºÍ¹ºÎï³µ´ËÀàµÄ¹¦ÄÜ
20) ServletÄܹ»ÔÚ·þÎñÆ÷¶Ë´¦Àí¿Í»§ÇëÇ󣬵±Óû§Ìá½»ÇëÇóºóÄܹ»½èÖúHttpServletRequest¶ÔÏóµÄ£¨ £©·½·¨»ñÈ¡¿Í»§¶ËÇëÇóÊý¾Ý
A. setAttribute() B. getAttribute() C. setParameter() D. getParameterValues()
21) ÒÔÏÂÑ¡Ïî¹ØÓÚGETºÍPOSTµÄÇø±ðÃèÊö²»ÕýÈ·µÄÊÇ£¨ £©¡£
×ÊÁϽö¹©²Î¿¼
A. GETÌá½»Êý¾ÝÔÚµØÖ·À¸ÄÚÏÔʾ£¬²»°²È«£»¶øPOSTÔò²»ÏÔʾ£¬Ïà¶Ô°²È«
B. ²ÉÓÃGET»òPOST·½Ê½Ìá½»Êý¾Ý£¬ÀíÂÛÉ϶¼Ã»Óг¤¶ÈµÄÏÞÖÆ
C. GETÇëÇóµÄÒ³ÃæÄܹ»ÉèÖÃΪÊéÇ©»òʹÓÃÓʼþ·¢ËÍ£»¶øPOST²»Äܹ»
D. ÓÉÓÚGET·½Ê½Ïà¶ÔÓÚPOST·½Ê½²»°²È«£¬Òò´Ë±àд³ÌÐòʱ£¬Ã»ÓÐÃ÷È·ÒªÇó£¬Ò»°ã¶¼²ÉÓÃPOST·½Ê½Ìá½»Êý¾Ý
22) ÒÔÏÂÑ¡Ïî¹ØÓÚJNDIÃèÊö²»ÕýÈ·µÄÊÇ£¨ £©¡£
A. ÔÚWebÓ¦ÓÃÖУ¬DataSourceÊÇÓÉWebÈÝÆ÷ÌṩµÄ£¬Òò´ËÐèÒª¾¹ýJNDIÀ´»ñµÃDataSource¶ÔÏó
B. ʹÓÃJNDIºÍÊý¾ÝԴʱ£¬ÐèÒªµ¼ÈëµÄ°ü°üÀ¨
£º
javax.naming.Context
¡¢¡¢¼°
javax.naming.InitialContextjavax.naming.NamingExceptionjavax.sql.DataSource
C. Javax.naming.ContextÌṩÁ˲éÕÒJNDI ResourceµÄ½Ó¿Ú¡£Äܹ»¾¹ýÈçÏ·½Ê½»ñÈ¡Êý¾ÝÔ´£º
Context ctx = new InitialContext();
×ÊÁϽö¹©²Î¿¼
DataSource ds =
(DataSource)ctx.lookup(\D. ʹÓÃJNDI»ñµÃÊý¾ÝÔ´£¬ÐèÒªÔÚcontext.xmlÎļþÖеÄ
ÏÂÁÐÑ¡ÏîÃèÊöÕýÈ·µÄÊÇ£¨ £©¡£
A. ÔÚ
B. ServletÈÝÆ÷»á¸ù¾Ý
C.
D. ÒÔÉÏÃèÊö¶¼²»ÕýÈ·
24) ÔÚWeb ÏîÄ¿µÄĿ¼½á¹¹ÖУ¬web.xmlÎļþλÓÚ£¨ £©ÖС£