一.HTTP中常用响应头 Location: http://www.it315.org/index.jsp Server:apache tomcat Content-Encoding: gzip Content-Length: 80 Content-Language: zh-cn Content-Type: text/html; charset=GB2312 Last-Modified: Tue, 11 Jul 2000 18:23:51 GMT Refresh: 1;url=http://ww…
学习资源主要为:@小坦克HTTP相关博客 一.请求头信息(Request Header) 请求头信息包含比较多,如下: 1.Cache头域 if-modified-Since 作用:把浏览器端缓存页面的最后修改时间发送到服务器去,服务器会把这个时间与服务器上的实际文件的最后修改时间进行对比.如果说时间一致,那么返回304,客户端就直接使用本地缓存文件.如果时间不一致,就会返回200和新的文件内容,客户端接到之后,会丢弃旧文件,把新文件缓存起来,并显示在浏览器中. if-none-match 作用…
1 常见的响应头 Location: http://www.it315.org/index.jsp     重定向的地址.配合302的状态码一起使用,实现重定向效果. Content-Type: text/html; charset=GB2312      服务器发送内容的数据类型及编码格式 Refresh: 1;url=http://www.it315.org             隔n秒之后跳转到另一个页面 / 每隔n秒刷新当前页面 Content-Disposition: attachm…
一.Servlet package autologin.servlet.login; import java.io.IOException;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException; import javax.servlet.ServletException;import javax.servlet.http.Cookie;import javax.servlet.http.H…
一.分页工具类 package blank.util;import java.util.List; import org.springframework.jdbc.core.JdbcTemplate; public class Pagination<T> { // 每页的数量    private long pageSize;    // 当前页    private long nowPage;    // 总页数    private long pages;    // 每页开始的记录数  …
一.servlet功能代码: public void doGet(HttpServletRequest request, HttpServletResponse response)            throws ServletException, IOException {        String value=request.getParameter("oper");        if("add".equals(value)){            /…
一.session销毁控制层代码 public class InvalidateSession extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response)            throws ServletException, IOException {        request.getSession().invalidate();//执行销毁session…
Java基础学习笔录 1.运行java程序,出现bad version number in.class file 编译器()的版本号高于运行环境(jre)的版本号,可以降低编译器版本号,也可以通过提升运行环境来改变 2.Java程序调试:用debug环境调试(设置断点) 注意事项: 3.快捷键: 1)配置快捷键:windows/preference 搜索关键字keys;首先检索要快捷执行的方法现有的快捷键,,remove掉现有的快捷键,在building后面添加新的快捷键 2) 3) 重置透视图…
使用JDBC.spring框架.servlet实现一个简单的用户登录功能. 一.mySql数据库 SET FOREIGN_KEY_CHECKS=0; -- ------------------------------ Table structure for user-- ----------------------------DROP TABLE IF EXISTS `user`;CREATE TABLE `user` (  `id` int(11) NOT NULL AUTO_INCREMEN…