本站首页    管理页面    写新日志    退出


«July 2025»
12345
6789101112
13141516171819
20212223242526
2728293031


公告
暂无公告...

我的分类(专题)

日志更新

最新评论

留言板

链接


Blog信息
blog名称:
日志总数:10
评论数量:25
留言数量:0
访问次数:89350
建立时间:2005年3月7日




log4j properties配置
软件技术

guan1200 发表于 2008/1/7 13:57:58



阅读全文(3948) | 回复(1) | 编辑 | 精华 | 删除
 


[java]Java安全通信、数字证书及应用实践
文章收藏

guan1200 发表于 2005/8/30 10:17:26



阅读全文(2957) | 回复(0) | 编辑 | 精华 | 删除
 


mysql:General error message from server: "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='"
文章收藏

guan1200 发表于 2005/8/27 18:13:45


阅读全文(2975) | 回复(0) | 编辑 | 精华 | 删除
 


[xml]Transformiix不支持disable-output-escaping的解决方法
文章收藏

guan1200 发表于 2005/7/14 16:57:28


阅读全文(3746) | 回复(0) | 编辑 | 精华 | 删除
 


[xml]XMLDOM属性列表
文章收藏

guan1200 发表于 2005/6/23 10:44:41


阅读全文(5252) | 回复(0) | 编辑 | 精华 | 删除
 


[xml]jsp生成静态的hmtl文件
文章收藏

guan1200 发表于 2005/6/2 11:51:14

jsp生成静态的hmtl文件
为了减轻服务器压力,将原来的文章管理系统由JSP文件的从数据库中取数据显示改为由jsp生成静态html文件后直接访问html文件。下面是一个简单的示例 1.buildhtml.jsp <%@ page contentType="text/html; charset=gb2312" import="java.util.*,java.io.*"%>
<%
try{
 String title="jsp生成静态html文件";
 String content="小样,还搞不定你?";
 String editer="hpsoft";
 String filePath = "";
 filePath = getServletContext().getRealPath("/")+"template.htm";
 out.print(filePath);
 String templateContent="";
 FileInputStream fileinputstream = new FileInputStream(filePath);//读取模块文件
 int lenght = fileinputstream.available();
 byte bytes[] = new byte[lenght];
 fileinputstream.read(bytes);
 fileinputstream.close();
 templateContent = new String(bytes);
 out.print(templateContent);
 templateContent=templateContent.replaceAll("###title###",title);
 templateContent=templateContent.replaceAll("###content###",content);
 templateContent=templateContent.replaceAll("###author###",editer);//替换掉模块中相应的地方
 out.print(templateContent);
 // 根据时间得文件名
 Calendar calendar = Calendar.getInstance();
 String fileame = String.valueOf(calendar.getTimeInMillis()) +".html";
 fileame = getServletContext().getRealPath("/")+fileame;//生成的html文件保存路径
 FileOutputStream fileoutputstream = new FileOutputStream(fileame);//建立文件输出流
 byte tag_bytes[] = templateContent.getBytes();
 fileoutputstream.write(tag_bytes);
 fileoutputstream.close();
}
catch(Exception e){
 out.print(e.toString());
} %> 模板文件 2. template.htm <html>
<head>
<title>###title###</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css.css" rel=stylesheet type=text/css>
</head> <body>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="2">
  <tr>
    <td align="center">###title###</td>
  </tr>
  <tr>
    <td align="center">作者:###author###&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td>###content###
 </td>
 
  </tr> </table>
</body>
</html>

阅读全文(2477) | 回复(0) | 编辑 | 精华 | 删除
 


[xml]XMLHttp 方式实现无刷屏,在IE,FireFox 上测试通过
文章收藏

guan1200 发表于 2005/6/2 11:07:42

XMLHttp 方式实现无刷屏,在IE,FireFox 上测试通过 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
html {background-color:#eeeeee}
body {
      background-color:#ccffcc;
      font-family:Tahoma,Arial,Helvetica,sans-serif;
      font-size:12px;
   margin-left:15%;
   margin-right:15%;
   border:3px groove #006600;
   padding:15px
  }
h1   {
      text-align:left;
      font-size:1.5em;
      font-weight:bold
     }
</style>
<script type="text/javascript">
// global flag
var isIE = false; // global request and XML document objects
var req; // retrieve XML document (reusable generic function);
// parameter is URL string (relative or complete) to
// an .xml file whose Content-Type is a valid XML
// type, such as text/xml; XML source must be from
// same domain as HTML file
function loadXMLDoc(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        isIE = true;
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
} // handle onreadystatechange event of req object
function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            clearTopicList();
            buildTopicList();
         } else {
            alert("There was a problem retrieving the XML data:\n" +
                req.statusText);
         }
    }
} // invoked by "Category" select element change;
// loads chosen XML document, clears Topics select
// element, loads new items into Topics select element
function loadDoc(evt) {
    // equalize W3C/IE event models to get event object
    evt = (evt) ? evt : ((window.event) ? window.event : null);
    if (evt) {
        // equalize W3C/IE models to get event target reference
        var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
        if (elem) {
            try {
                if (elem.selectedIndex > 0) {
                    loadXMLDoc(elem.options[elem.selectedIndex].value);
                } 
            }
            catch(e) {
                var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
         &n

阅读全文(2939) | 回复(0) | 编辑 | 精华 | 删除
 


[xml]xml模板语言xsl应用列
文章收藏,  电脑与网络

guan1200 发表于 2005/4/13 16:59:33



(下面还有4767字)

阅读全文(3515) | 回复(0) | 编辑 | 精华 | 删除
 


[文章收集]tomcat下数据源的配置、解释和调用方法
文章收藏

guan1200 发表于 2005/4/5 23:42:02



(下面还有81字)

阅读全文(4377) | 回复(0) | 编辑 | 精华 | 删除
 


« 1



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.080 second(s), page refreshed 144779522 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号