1什么是MVC模式,是否所有JSP应用都该采用MVC模式,请说明理由?
2. 在Struts应用的模型中包含哪些组件?(多选)
(A) JSP
(B) Servlet
(C) ActionServlet
(D) Action
(E)代表业务逻辑或业务数据的JavaBean
(F) EJB
(G) 客户化标签
3. 在Struts应用的控制器中包含哪些组件?(多选)
(A) JSP
(B) Servlet
(C) ActionServlet
(D) Action
(E)代表业务逻辑或业务数据的JavaBean
(F) EJB
(G) 客户化标签
4.以下代码定义了一个变量,如何输出这个变量的值?(多选)
<bean:define id=\"stringBean\" value=“helloWorld“/>
选项:
(A)<bean:write name=“stringBean\"/>
(B) <bean:write name=“helloWorld\"/>
(C)<%= stringBean%>
(D)
<% String myBean=
(String)pageContext.getAttribute(“stringBean”,PageContext.PAGE_SCOPE);
%>
<%=myBean%>
5.请列出Struts标签库所包含的几种标签库.
6.把静态文本放在Resource Bundle中,而不是直接在JSP文件中包含这些静态文本,有什么优点?(多选)
A)提高可维护性
B)提高可重用性
C)支持国际化
D)提高运行速度
7以下哪些说法是正确的?(单选)
(A)每个HTTP请求对应一个单独的ActionServlet实例
(B)对于每个请求访问HelloAction的HTTP请求,Struts框架会创建一个单独的HelloAction实例。
(C)每个子应用对应一个单独的RequestProcessor实例
(D)每个子应用对应一个单独的web.xml文件
8下面哪些任务是RequestProcessor完成的?(多选)
选项:
(A)把Struts配置文件信息加载到内存中
(B)把资源文件信息读入到内存中
(C)如果需要的话,创建ActionForm实例,组装数据,并进行表单验证
(D)找到匹配的Action实例,调用其execute()方法
(E)把请求转发到Action的execute()方法返回的ActionForward代表的组件。
9.对于以下代码,HelloAction希望把请求转发给hello.jsp,在HelloAction的execute()方法中如何实现?(多选)
<action path = \"/HelloWorld\"
type = \"hello.HelloAction\"
name = \"HelloForm\"
scope = \"request\"
validate = \"true\"
input = \"/hello.jsp\"
>
<forward name=\"SayHello\" path=\"/hello.jsp\" />
</action>
选项:
(A) return (new ActionForward(mapping.getInput()));
(B) return (mapping.findForward(\"SayHello\"));
(C) return (mapping.findForward(“hello.jsp\"));
10.简述struts工作流程.