public static void AddCookie(HttpServletResponse response, String key, String value) { Cookie cookie = new Cookie(key, value); response....
分类:
编程语言 时间:
2015-09-14 15:33:23
阅读次数:
137
@RequestMapping("downLoad") public void downLoad(Offsupervise off1,HttpServletRequest request,HttpServletResponse response,HttpSession session) thr...
分类:
Web程序 时间:
2015-09-11 12:25:18
阅读次数:
211
OrderServlet #createOrder 1 /* 2 * 3 * 生成订单 4 */ 5 public String createOrder(HttpServletRequest req, HttpServletResponse resp) 6 ...
分类:
其他好文 时间:
2015-09-10 11:09:45
阅读次数:
181
rsponse常见应用:a.使用OutputStream向客户端写入中文: String data = "中国"; OutputStream stream = response.getOutputStream();//获取一个向Response对象写入数据的流,当tomcat服务器进行响应的时候,会...
分类:
Web程序 时间:
2015-09-10 01:45:07
阅读次数:
166
在jsp文件中:Insert title here">get乱码问题java文件:protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IO...
分类:
Web程序 时间:
2015-09-07 19:29:37
阅读次数:
145
普通的ajax请求是无法跨域的!如: 点会抛出一个异常:根据提示,可以添加一个响应头来解决这个问题: @RequestMapping("now") @ResponseBody public String now(HttpServletResponse response) {...
分类:
编程语言 时间:
2015-09-06 19:59:35
阅读次数:
185
1.设置字符编码,避免中文乱码protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ...
分类:
其他好文 时间:
2015-09-02 20:42:48
阅读次数:
170
1xx - 信息提示这些状态代码表示临时的响应。客户端在收到常规响应之前,应准备接收一个或多个 1xx 响应。·0 - 本地响应成功。 · 100 - Continue 初始的请求已经接受,客户应当继续发送请求的其余部分。(HTTP 1.1新) · 101 - Switching Protocols...
分类:
Web程序 时间:
2015-09-02 10:42:44
阅读次数:
171
用encodeURL重写URL public class SessionA extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws .....
分类:
其他好文 时间:
2015-08-31 23:21:43
阅读次数:
207
1.在servlet中上传图片,上传的文件夹是imge在webroot下,主要代码如下private void saveImage(HttpServletRequest request, HttpServletResponse response) throws IOException { ...
分类:
Web程序 时间:
2015-08-31 19:17:24
阅读次数:
294