随笔分类 - Servlet
关于getClass().getClassLoader()
摘要:InputStream is = getClass().getClassLoader().getResourceAsStream("helloworld.properties");中getClass()和getClassLoader()都是什么意思呀.getClass():取得当前对象所属的Clas
阅读全文
After reading a picture than out a picture
摘要:protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //设置响应文本类型 response.setContentTy
阅读全文
Servlet的生命周期
摘要:Servlet的生命周期分为5个阶段:加载、创建、初始化、处理客户请求、卸载。 (1)加载:容器通过类加载器使用servlet类对应的文件加载servlet (2)创建:通过调用servlet构造函数创建一个servlet对象 (3)初始化:调用init方法初始化 (4)处理客户请求:每当有一个客户
阅读全文
Servlet 与 CGI 的比较
摘要:和CGI程序一样,Servlet可以响应用户的指令(提交一个FORM等等),也可以象CGI程序一样,收集用户表单的信息并给予动态反馈(简单的注册信息录入和检查错误)。然而,Servlet的机制并不仅仅是这样简单的与用户表单进行交互。传统技术中,动态的网页建立和显示都是通过CGI来实现的,但是,有了S
阅读全文
浙公网安备 33010602011771号