[ 来源:www.it55.com | 作者: | 时间:2007-07-14 | 收藏 | 推荐 ] 【大 中 小】
做了一小段xml.与大家交流。
三个文件。(blue.xml blue.xsl blue.css )拷到本地同一目录下。 www.it55.com
blue.xml: www.it55.com在线教程
<?xml version='1.0' encoding='GB2312'?>
<?xml:stylesheet type='text/xsl' href='http://edu.iecool.com/show/blue.xsl'?>
<Topic>
<Issue>
<TopicId>000001</TopicId>
<UserName>ycoe12</UserName>
<RankName>超级用户</RankName>
<TopicName>[JSP]Servlet中线程的问题</TopicName>
<DateTime>2005-12-26 01:03:44</DateTime>
<ReplyNum>2</ReplyNum>
<ReadNum>68</ReadNum>
<Content>请问一下怎样实现在Servlet里使用线程。比如用两线程,让一个线程与另一个线程通讯。
我的方法: implements Runnable 。生成后马上让它sleep。但是我不知道怎样让另一个线程在完成后通知此线程??(两个请求之间通讯)
我想在是通过检测HttpSession来判断另一个线程的进程的。但这样好像不太好。。。
谢谢</Content>
</Issue>
<Replys> IT资讯之家 www.it55.com
<Reply>
<TopicID>000001</TopicID>
<UserName>红色黑客</UserName>
<RankName>经典杀手</RankName>
<ReplyID>0001</ReplyID>
<Content>这个应该用线程同步吧??</Content>
<DateTime>2005-12-26 13:22:15</DateTime>
</Reply>
<Reply>
<TopicId>000001</TopicId>
<UserName>ycoe12</UserName>
<RankName>超级用户</RankName>
<ReplyID>0002</ReplyID>
<Content>不是,简单地说就是用一个线程完成后去通知另一个线程。。。不是,简单地说就是用一个线程完成后去通知另一个线程。。。不是,简单地说就是用一个线程完成后去通知另一个线程。。。</Content>
<DateTime>2005-12-26 20:41:51</DateTime>
</Reply>
blue.xsl: http://www.it55.com/
<?xml version="1.0" encoding="GB2312"?>
<!--
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="gb2312" version="4.0"/>
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="text()" >
<xsl:value-of/>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312"/>
<title><xsl:value-of select="Topic/Issue/TopicName"/></title>
<link REL='Stylesheet' HREF='http://edu.iecool.com/show/blue.css' TYPE='text/css'/>
</head>
<body>
<div id="divFrame">
<div id="divTitle">
<span id="spanTitleLeft"><xsl:value-of select="Topic/Issue/TopicName"/></span>
<span id="spanTitleRight">作者:<xsl:value-of select="Topic/Issue/UserName"/> | <xsl:value-of select="Topic/Issue/RankName"/>| 发表时间:<xsl:value-of select="Topic/Issue/DateTime"/></span>
blue.css:
body
{
text-align:center;
background-color:#ffffff;
}
div
{
font-family:Verdana;
text-align:left;
}
#divFrame
{
background-color:#CCCCCC;
width:95%;
padding:8px;
}
#divTitle
{
background-color:#F7F3F7;
border:1px solid black;
width:100%;
font-size:16px;
font-weight:bold;
line-height:30px;
color:#0051A5;
padding-left:10px;
}
#divMain
{
font-size:14px;
margin-top:5px;
border:1px solid black;
padding:10px;
(编辑:IT资讯之家 www.it55.com)