11、在Struts中,控制器功能的核心是一個( C )對象。
A.Action B.ActionMapping
C.ActionServlet D.Request
12、在使用HttpSession維護當(dāng)前在線人數(shù)的WEB應(yīng)用中,當(dāng)一個客戶離開WEB應(yīng)用時,將激發(fā)( B )?
A.ServletContextListener監(jiān)聽器的contextDestroyed( )方法
B.HttpSessionListener監(jiān)聽器的sessionDestroyed( )方法
C.ServletContextAttributeListener監(jiān)聽器的attributeRemoved( )方法
D.HttpSessionAttributeListener監(jiān)聽器的attributeRemoved( )方法
13、在一個JSP頁面中,JSP引擎不處理的部分稱為( D )
A.腳本 B.表達式
C.聲明 D.模板文件
14、變量conn引用某個連接到ODBC數(shù)據(jù)源的Connection對象,為了查詢表Employees中所有記錄并放入結(jié)果集rs,則應(yīng)選用下列哪條語句?( A )
A.Statement stmt=conn.creatStatement();
ResultSet rs=stmt.executeQuery(“select * from emloyees”);
B.Statement stmt=conn.creatStatement ();
ResultSet rs=stmt.executeUpdate (“select * from emloyees”);
C.PreparedStatement stmt=conn.prepareStatement();
ResultSet rs=stmt.executeQuery(“select * from emloyees”);
D.PreparedStatement stmt=conn.prepareStatement(“select * from emloyees”);
ResultSet rs=stmt.executeUpdate ();
15、對客戶請求訪問HTML頁面與訪問Servlet的不同點描述正確的是?( C )
A.前者使用HTTP協(xié)議,后者使用RMI協(xié)議
B.前者Web服務(wù)器直接返回HTML頁面,后者Web服務(wù)器返回的是Servlet的源代碼
C.前者Web服務(wù)器直接返回HTML頁面,后者Web服務(wù)器調(diào)用Servlet的方法,
由Servlet動態(tài)生成HTML頁面
D.前者必須運行在web容器中,后者不一定
16、關(guān)于HttpSession會話對象的屬性,正確的選項是?( B )
A.綁定到HttpSession對象上的屬性在應(yīng)用程序的生存期內(nèi)總是有效的
B.會話屬性是特定用戶的專用數(shù)據(jù),同時訪問WEB應(yīng)用的其他用戶無法訪問這些屬性
C.使用HttpSession對象的addAttribute方法添加會話屬性
D.使用HttpSession對象的removeAttributeNames方法刪除會話屬性
17、在一個JSP頁面中,下列哪個選項的內(nèi)容是在客戶端瀏覽器中可見的注釋?( D ) A.<% /*“Hello world!”*/ %> B.<% //“Hello world!” %> C.<%--“Hello world!”--%> D.
18、Servlet可通過由容器傳遞來的HttpServletRequest對象的( B )方法來獲取客戶請求URL中使用的協(xié)議類型。
A.getParameter B.getProtocol
C.getContentType D.getAttribute
19、在JSP頁面編程中,頁面跳轉(zhuǎn)可以采用如下那種方法實現(xiàn)?( C )
A.response.forward B.request.include
C.response.sendRedirect D.request.setAttribute
20、Page指令用于定義JSP頁面的全局屬性,下列關(guān)于該指令的描述不正確的是?( D )
![]() | ![]() .. 定價:¥45 優(yōu)惠價:¥42 更多書籍 |
![]() | ![]() .. 定價:¥225 優(yōu)惠價:¥213 更多書籍 |