百度怎么发布问题
Exceptioninthread"main"java.util.regex.PatternSyntaxException:Illegalrepetitionnearin...
Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repetition near index 26
($region).made-in-china.com{region=(dongguan|foshan|fujian|guangzhou|hangzhou|henan|jinhua|nanjing|ningbo|qingdao|qinghai|shanghai|shenzhen|sichuan|suzhou|taiwan|wenzhou|wuxi|zhongshan)}
上面的正则表达式哪里错啦。求解释,应该怎么写呢?? 展开
($region).made-in-china.com{region=(dongguan|foshan|fujian|guangzhou|hangzhou|henan|jinhua|nanjing|ningbo|qingdao|qinghai|shanghai|shenzhen|sichuan|suzhou|taiwan|wenzhou|wuxi|zhongshan)}
上面的正则表达式哪里错啦。求解释,应该怎么写呢?? 展开
1个回答
展开全部
public MimeMultipart CreatHtmlMultipart(List<String> aContentpic) throws IOException, MessagingException{
logger.info("创建带图片html MimeMultipart");
MimeMultipart contentMultipart = new MimeMultipart("related");
//创建保存图片的MimeBodyPart并保存
//图片cid为图片编号,0开始
List<String> Contentpic = aContentpic;
logger.info("List contentpic.size() == "+ new Integer(Contentpic.size()).toString());
for(int i=0;i<Contentpic.size();i++)
{
MimeBodyPart tempBodyPart = new MimeBodyPart();
String filename = Contentpic.get(i);
FileDataSource fileDataSorce = new FileDataSource(filename);
tempBodyPart.setDataHandler(new DataHandler(fileDataSorce));
tempBodyPart.setContentID(new Integer(i).toString());
String newPicName ="cid:"+new Integer(i).toString();
text.replaceAll(filename, newPicName);
contentMultipart.addBodyPart(tempBodyPart);
}
//创建代表MIME消息的MimeMultipart对象
//创建保存html正文的MimeBodyPart对象,保存到MimeMultipart中
MimeBodyPart htmlBodyPart = new MimeBodyPart();
htmlBodyPart.setContent(text,"text/html;charset=gb2312");
contentMultipart.addBodyPart(htmlBodyPart
logger.info("创建带图片html MimeMultipart");
MimeMultipart contentMultipart = new MimeMultipart("related");
//创建保存图片的MimeBodyPart并保存
//图片cid为图片编号,0开始
List<String> Contentpic = aContentpic;
logger.info("List contentpic.size() == "+ new Integer(Contentpic.size()).toString());
for(int i=0;i<Contentpic.size();i++)
{
MimeBodyPart tempBodyPart = new MimeBodyPart();
String filename = Contentpic.get(i);
FileDataSource fileDataSorce = new FileDataSource(filename);
tempBodyPart.setDataHandler(new DataHandler(fileDataSorce));
tempBodyPart.setContentID(new Integer(i).toString());
String newPicName ="cid:"+new Integer(i).toString();
text.replaceAll(filename, newPicName);
contentMultipart.addBodyPart(tempBodyPart);
}
//创建代表MIME消息的MimeMultipart对象
//创建保存html正文的MimeBodyPart对象,保存到MimeMultipart中
MimeBodyPart htmlBodyPart = new MimeBodyPart();
htmlBodyPart.setContent(text,"text/html;charset=gb2312");
contentMultipart.addBodyPart(htmlBodyPart
追问
大哥,这是什么乱七八糟的东西?你看题了吗?
追答
其中的答案就里面.外国人给我的
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询