2008-03-24

获取工程路径(jar和普通文件结构通用) -- java

关键字: jar 路径 工程路径
 /** * 获取工程所在目录 * @return * @throws UnsupportedEncodingException */ private static String getProjectPath() throws UnsupportedEncodingException{ URL url = [ThisClass].class.getProtectionDomain().getCodeSource().getLocation(); String filePath = URLDecoder.decode(url.getPath(), ...
2008-03-14

答复: 奇怪的Servlet中文乱码问题

关键字: printwriter out 乱码
PrintWriter out=response.getWriter(); request.setCharacterEncoding("UTF-8"); // response.setContentType(CONTENT_TYPE); 将上面的代码顺序改为如下代码: request.setCharacterEncoding("UTF-8"); response.setContentType(CONTENT_TYPE); PrintWriter out=r ...
JoeDanny
搜索本博客
最近加入圈子
存档
最新评论