第一次课
在手机上记的,内容非常简略,不过好在第一节课本身也没提供什么有价值的新内容,大部分时间都是在复习小学期的内容。
异常
-
检查异常
-
运行异常
编译器不做任何检查,可由码力完全避免
抽象与灵活性的正相关性
第二次课
- Client -> Server (Request)
- Server -> Client (Servlet -> Response)
protocol: Host Addr / File Addr
protocol Host Addr File Addr
e.g.: https:// rama.works /prototype
使用Servlet Response,配合PrintWriter来输出数据
服务器Push技术,区别与以前的基于请求的连接
HTTP, Content-Type: MIME TYPE (考试不考)
text/html
text/plain
text/xml
text/json
application/pdf
application/octet-stream -> download
必考
servlet概念,方法(destroy(), new, init(), service()),生命周期
getParameter(String name)
init(ServletConfig config)
public class Temp implements Servlet {
private ServletConfig config;
public void init(ServletConfig config) {
this.config = config;
}
public void destroy() {
this.config.destroy();
}
public void service(ServletRequest res, ServletResponse, response)
throws ServletException, IOException {
// emitted
}
}
Query String -> ServletRequest Parameter -> getParameter()
getParameter
送分题
getOutputStream
获得输出
请求状态
404 Not Found
403 Forbidden
200 OK