servlet
xiaosha_
不想做咸鱼……努力挣扎……
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
关于java中servlet使用Write乱码问题
1)更好 会让浏览器自动调整解码的编码 response.setContentType("text/html;charset=utf-8"); 2)不太好 不会让浏览器自动改变解码的码表 有时候还是乱码 response.setContentType("text/html"); response.setCharacterEncoding("utf-8");原创 2017-08-16 09:36:35 · 297 阅读 · 0 评论 -
JavaEE关于全局参数的
在web.xml中 AAA AAA'Value BBB BBB'Value 在servlet中 ServletContext context = this.getServletContext(); Enumeration enums = context.getInitParameterNames(); while (enums.ha原创 2017-08-20 09:55:34 · 496 阅读 · 0 评论 -
关于javaEE,如何在Tomcat启动时加载servlet
name package.name 1原创 2017-08-19 19:25:30 · 823 阅读 · 0 评论 -
JavaEE中servlet局部参数
在web.xml中 ConfigDemo gz.nuist.d_config.ConfigDemo 1 --> path D:/users.txt 在servlet中 String path = null; path = this.getServletConfig().getInitParameter("path");原创 2017-08-20 10:08:52 · 365 阅读 · 0 评论 -
JavaEE中servlet中的资源地址问题
/** * 1)getRealPath() 获取真实路径 */ /* String path = this.getServletContext().getRealPath("/WEB-INF/classes/news.properties"); System.out.println(path); FileInputStream in = new FileInpu原创 2017-08-20 18:16:23 · 360 阅读 · 0 评论 -
关于java里面servlet获取参数乱码问题
对于doPost. request.setCharacterEncoding("utf-8"); 对于doGet 手动解码 value=new String(value.getBytes("iso-8859-1","utf-8"));原创 2017-08-16 08:01:13 · 545 阅读 · 0 评论
分享