2018年1月21日

过滤器

摘要: void init(FilterConfig config): 用于完成Filter 的初始化。 void destroy(): 用于Filter 销毁前,完成某些资源的回收。 void doFilter(ServletRequest request, ServletResponse respons 阅读全文

posted @ 2018-01-21 22:11 小欣柑 阅读(103) 评论(0) 推荐(0) 编辑

2018年1月17日

怎样在servlet中得到application、session对象

摘要: ServletContext application = this.getServletContext(); application.setAttribute(" "," "); HttpSession session = request.getSession(); session.setAttri 阅读全文

posted @ 2018-01-17 22:31 小欣柑 阅读(218) 评论(0) 推荐(0) 编辑

2018年1月15日

jsp页面简单用*号替换敏感词

摘要: 1.在项目的web.xml写入 <context-param> <param-name>noWords</param-name> <param-value>你需要的敏感词</param-value> </context-param> 2.再post提交页面写入 request.setCharacte 阅读全文

posted @ 2018-01-15 18:29 小欣柑 阅读(294) 评论(0) 推荐(0) 编辑

2018年1月14日

jsp网页根据传递value值选中复选框

摘要: //post提交页面 request.setCharacterEncoding("utf-8"); //注意加上 否则post提交的值会乱码 String ip =request.getRemoteAddr(); //获取本机ip作为key值 String[] value = request.get 阅读全文

posted @ 2018-01-14 21:16 小欣柑 阅读(1412) 评论(0) 推荐(0) 编辑

2018年1月12日

简单实现网页信息分页显示

摘要: <%! int toptalPageCount=0; //信息总页数 int pageSize = 5; //页面大小,即每页显示的记录数 int totalCount; //信息的总条数 int index=0; Connection con = null; PreparedStatement p 阅读全文

posted @ 2018-01-12 20:39 小欣柑 阅读(969) 评论(0) 推荐(0) 编辑

2018年1月11日

数据库连接池

摘要: JNDI(简单理解为是一种将对象和名字绑定的技术,应用程序可以通过名字获取对应的对象或服务): 提供了查找和访问各种命名和访问各种命名和目录服务的通用、统一的接口。 context.xml文件<Coutext>内写入: <Environment name="myname" value="lzx" t 阅读全文

posted @ 2018-01-11 21:51 小欣柑 阅读(267) 评论(0) 推荐(2) 编辑

2018年1月10日

request、seesion、application、response常用方法

摘要: (转发)request对象常用方法:(主要用于处理客户端请求的数据信息) String getParameter()根据页面表单组件名称获取页面提交数据 String[] getParameterValues()获取一组以相同命名的表单组件提交的数据 void setCharacterEncodin 阅读全文

posted @ 2018-01-10 20:39 小欣柑 阅读(355) 评论(0) 推荐(4) 编辑

导航