Servlet/JSP/数据库的笔试及面试题

本文涵盖了Servlet、JSP和数据库的相关面试题,包括应用服务器、异常、JSP内置对象、指令、Servlet生命周期、页面间对象传递、JSP与Servlet的异同、数据库操作及SQL优化等内容,旨在帮助准备JavaWeb面试者全面理解核心技术点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.   应用服务器有那些?
BEA WebLogic Server,IBMWebSphere Application Server,Oracle9i ApplicationServer,jBoss,Tomcat

2.   给我一个你最常见到的runtime exception。
ArithmeticException, ArrayStoreException,BufferOverflowException, BufferUnderflowException, CannotRedoException,CannotUndoException, ClassCastException, CMMException,ConcurrentModificationException, DOMException, EmptyStackException,IllegalArgumentException, IllegalMonitorStateException,IllegalPathStateException, IllegalStateException, ImagingOpException,IndexOutOfBoundsException, MissingResourceException,NegativeArraySizeException, NoSuchElementException, NullPointerException,ProfileDataException, ProviderException, RasterFormatException,SecurityException, SystemException, UndeclaredThrowableException,UnmodifiableSetException, UnsupportedOperationException

3.   JSP的内置对象及方法。
request表示HttpServletRequest对象。它包含了有关浏览器请求的信息,并且提供了几个用于获取cookie, header, 和session数据的有用的方法。
response表示HttpServletResponse对象,并提供了几个用于设置送回 浏览器的响应的方法(如cookies,头信息等)
out对象是javax.jsp.JspWriter的一个实例,并提供了几个方法使你能用于向浏览器回送输出结果。
pageContext表示一个javax.servlet.jsp.PageContext对象。它是用于方便存取各种范围的名字空间、servlet相关的对象的API,并且包装了通用的servlet相关功能的方法。
session表示一个请求的javax.servlet.http.HttpSession对象。Session可以存贮用户的状态信息
applicaton 表示一个javax.servle.ServletContext对象。这有助于查找有关servlet引擎和servlet环境的信息
config表示一个javax.servlet.ServletConfig对象。该对象用于存取servlet实例的初始化参数。
page表示从该页面产生的一个servlet实例

4.   JSP的常用指令
<%@page language="java"contenType="text/html;charset=gb2312" session="true"buffer="64kb" autoFlush="true"isThreadSafe="true" info="text"errorPage="error.jsp" isErrorPage="true" isELIgnored="true"pageEncoding="gb2312" import="java.sql.*"%>
isErrorPage(是否能使用Exception对象),isELIgnored(是否忽略表达式)
<%@include file="filename"%>
<%@taglib prefix="c"uri="http://......"%>

5.   什么情况下调用doGet()和doPost()?以及servlet的生命周期?
Jsp页面中的form标签里的method属性为get时调用doGet(),为post时调用doPost()。


we

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值