鱼C论坛

 找回密码
 立即注册
查看: 88|回复: 1

jsp

[复制链接]
发表于 2024-3-24 11:34:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
1. which life cycle method makes ready theservlet for garbage collection?
A.init
B.service
C.system.gc
D.destroy
2.lf servlet receives multiple requests, howmany objects will it create?
A.only one
B.many
C.Both A and B
D.None of above
3. Which web.xml tag is used to set servletconfig parameter
A.<param></param>
B.<init-param></init-param>
C.<context-param></context-param>
D.None of the above
4. Which of the following method setsapplication/context init parameter?
A.setParameter(String name,String value)
B.setParameter(String name,Object value)
C.setParameter(Object
value)
name,Object
D.Its not possible in the method
5. Servlet Config init parameter set in
A.Web.xml
B.Servlet class
C.Both A and B
D.None of the above

6.object is available to anyservlet or JSPs that are part of the webapp and provides communicationpetween servets and JSPs
A.Servlet
B.ServletConfig
C.ServletContext
D.HttpServletContext
7.“request” is an instance of which oneof the following classes
A.Request
B.HttpRequest
C.HttpServletRequest
D.ServletRequest
8. Which of the following method can beused to get the multiple values of aparameter like checkbox data?
A.equest.getParameter()
B.request.getParameterValues()
C.request.getParameterNames()
D.None of the above
9. Which type of statement can executeparameterized queries?
A.PreparedStatement
B.arameterizedStatement
C.ParameterizedStatementCalableStatement
and
Statement
10.which method is used to perform DMLstatements in JDBC?
A.execute()
B.xecuteQuery()
C.executeUpdate()
D.executeResult()

@Fich_C
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-3-24 11:35:02 | 显示全部楼层
1. D. destroy 方法会在 servlet 准备进行垃圾回收时被调用。
2. B. 当 servlet 接收到多个请求时,它会创建多个对象。
3. B. 使用 `<init-param>` 标签可以设置 servlet 的配置参数。
4. A. 使用 `setParameter(String name, String value)` 方法可以设置应用程序/上下文初始化参数。
5. C. 初始化参数可以在 web.xml 文件中设置,也可以在 servlet 类中设置。
6. C. ServletContext 对象可用于 Web 应用程序的所有 servlet 和 JSP 页面之间进行通信。
7. C. "request" 是 HttpServletRequest 类的一个实例。
8. B. 使用 `request.getParameterValues()` 方法可以获取多个参数值,如多选框的数据。
9. A. 使用 PreparedStatement 可以执行带有参数的查询。
10. C. 使用 executeUpdate() 方法可以执行 DML 语句。

请注意,以上为问题的回答,并不包含完整的代码实现。如果需要代码示例,请提供更具体的问题描述和需求。

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-27 13:50

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表