2013年7月22日

java去掉jsp标签内容的方法

摘要: //去掉内容的标签 public static String removeTag(String count){ try { int tagCheck=-1; do { int a = count.indexOf(""); int len = count.length(); String c=null; c = count.substring(0, a); if(b == -1) b = a; String d = count.substring((b + 1), len); count = c + d; tagCheck = count.indexOf(""); } while (tagCheck != -1); } catch (Exception e) { System.out.println("去掉内容标签异常,可能是该内容 阅读全文

posted @ 2013-07-22 13:00 qgc 阅读(561) 评论(0) 推荐(0)

使用java发送邮件sp自动发送邮件方法

摘要: //发送邮箱 public static String sendEmail(String sendFrom,String sendTo,String passWord,String title,String count){ try{ String from =sendFrom.trim();//发送者 String to =sendTo.trim();//接受者 String subject =title.trim();//主题 String content =count.trim();//内容 String password =passWord.trim();//发送者邮箱密码 String path="null";//附件的路径 String mailserver ="smtp."+from.substring(from.indexOf('@')+1,from.length()); //在Internet上发送邮件时的代码(smtp服务器地址) Properties prop = 阅读全文

posted @ 2013-07-22 12:59 qgc 阅读(309) 评论(0) 推荐(0)

spring+jpg环境下,spring实现文件下载web实现通用的文件下载方法

摘要: response.setCharacterEncoding("UTF-8"); response.setContentType("text/html"); javax.servlet.ServletOutputStream ou = response.getOutputStream(); //文件名 // String filename=new String(fileName.getBytes("ISO8859_1"),"GB2312").toString(); //路径 java.io.File file = new java.io.File(urlandfile); if (!file.exists()) { System.out.println(file.getAbsolutePath() + " 文件不能存在!"); msg="unexists"; return msg; } // 读取文件流 阅读全文

posted @ 2013-07-22 12:51 qgc 阅读(412) 评论(0) 推荐(0)

导航