![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
servlet
sujingnuli1
这个作者很懒,什么都没留下…
展开
-
servlet读取properties文件
根据properties所在的位置不同,有不同的读法: (1)如果是在src下面: InputStream in=this.getclass().getResourceAsStream("/db.properties"); (2)如果是在webcontent目录下面: inputStream in=this.getServletContext().getResourceAsStream("原创 2015-12-31 13:51:42 · 1137 阅读 · 0 评论 -
servlet-------HttpServletRequest对象
(1)tomcat将请求信息封装到HttpServletRequest对象中 (2)tomcat调用tomcat方法,并且把HttpServletRequest对象作为参数传入。 (3)使用doGet方法获取请求头和请求行,使用doPost方法获取请求实体。 获取请求头: public void doGet(HttpServletRequest req,HttpServletRes原创 2015-12-22 11:50:47 · 276 阅读 · 0 评论