在web.xml中加入
<mime-mapping>
<extension>xls</extension>
<mime-type>application/excel</mime-type>
</mime-mapping>
服务器端同时安装上Excel
posted @
2009-03-26 10:29 sure_xx 阅读(93) |
评论 (0) |
编辑 收藏
摘要: 1.用spring的mail发邮件需要将j2ee包里的mail.jar和activation.jar引入
2.遇见的异常可能会有
(1)java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
(2)java.lang.NoClassDefFoundErro...
阅读全文
posted @
2008-10-18 16:18 sure_xx 阅读(1372) |
评论 (4) |
编辑 收藏
1.String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, "");
}
String.prototype.Rtrim = function()
{
return this.replace(/(\s*$)/g, "");
}
2.全文匹配替换
var regExp = new RegExp("需要被替换的字符',"g")
var text = "…………";
text = text.replace(regExp , "替换的字符");
3.方案
String .prototype.trim = function(){
var matches = this.match(/^[ \t\n\r]+/);
var prefixLength = (matches == null) ? 0:matches[0].length;
matches = this.match(/[ \t\r\n]+$/);
var suffixLength = (matches == null) ? 0:matches[0].length;
return this.slice(prefixLength,this.length-suffixLength);
}
posted @
2008-08-27 16:12 sure_xx 阅读(757) |
评论 (0) |
编辑 收藏
1.写文件并设置encoding
OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("GBK");
output = new XMLWriter(new FileWriter(new File(filename)), format);
output.write(document);
2.先删文件再创建
File file = new File("d://xxx.xml");
if(file.exists()){
file.delete();
}
CreatXml temp = new CreatXml();
temp.createXMLFile("d://xxx.xml")
posted @
2008-08-20 23:50 sure_xx 阅读(207) |
评论 (0) |
编辑 收藏
重新给sys设计一个新口令
sqlplus /nolog
connect / as sysdba
alter user sys identified by '新口令';
给scott解锁:
alter user scott account unlock;
posted @
2008-08-19 23:33 sure_xx 阅读(146) |
评论 (1) |
编辑 收藏