(1)在命令行中運(yùn)用Jar命令
假定有一個(gè)Web應(yīng)用:C:\myHome
myHome/WEB-INF/……
myHome/files/……
myHome/image/……
myHome/src/……
myHome/index.jsp
在命令行窗口下執(zhí)行如下命令:
C:\>cd myHome
C:\myHome\>jar????? cvf????? myhome.war????? *.*/???? .
解釋?zhuān)?strong>jar????? cvf????? [A->war包名].war?? [B->資源文件及文件夾]????? [C->將要生成war包的目標(biāo)文件夾]
“*.*/”(B->)代表當(dāng)前目錄(C:\myHome)下的所有文件及文件夾。
“.”??? (C->)表明將要在當(dāng)前目錄中生成war包。
操作完成后,找到C:\myHome下新生成的myhome.war,將其拷入TOMCAT_HOME/webapps/下。然后啟動(dòng)Tomcat即可。
(2)利用IDE工具打包,如Eclipse
右鍵點(diǎn)擊你想打包的文件或者項(xiàng)目,選擇“導(dǎo)出...”,在彈出的對(duì)話(huà)框中選擇“WAR文件” ,上面有許多選項(xiàng),還可以選“EAR”,“JAR”,個(gè)人覺(jué)得這個(gè)很方便的!
(3)利用ANT工具打包
首先配置好build.xml文件,然后dos下輸入ant ...war
(4)用Eclipse的lomboz插件
選中你的web工程,lomboz J2ee---Deploy Module,就可以把Web工程發(fā)布并打包了!
<html>代碼:
<html>
<head>
<title>Title of Document</title>
<script src="path-to-file/fileName.js"></script>
</head>
<body>
The content of
your page goes here.
</body>
</html>
HTML Template Page supporting the JavaScript
代碼:
<html>
<head>
<title>HTML Template Page</title>
<script language="javascript">
<!--
// -->
</script>
</head>
<body>
</body>
</html>
Use the 'script' tag to incluse your javascript code
代碼如下:
<html>
<head>
<title>Title of Document</title>
<script>
// All Your Javascript Code goes In Here Between the opening and closing script tags.
</script>
</head>
<body>
The content of
your page here.
</body>
</html>
Use self to reference the current document
代碼如下:
<html>
<head>
<script language="JavaScript" type = "text/javascript">
<!--
if (top==self)
{
???? var main_frame = "
???? var cur_url = self.location.href;
???? var setframes = main_frame + "?" + cur_url;
???? location.href = setframes;
}
//-->
</script>
</head>
<body>
</body>
</html>
1. 在<head></head>區(qū)域加入代碼:
<meta http-equiv=Pragma content=no-cache>
<Meta http-equiv="refresh" content="3;url='http://hi.baidu.com/jadmin' ">
2. 使用JavaScript代碼:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
redirTime = "3000";
redirURL = "http://hi.baidu.com/jadmin";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
//?? End -->
</script>
<body onLoad="redirTimer()">
3. 使用JavaScript代碼:
<html><head><title>稍候。。。</title></head>
<body>
<script language='javascript'>document.location = 'http://hi.baidu.com/jadmin'</script>
</body>
</html>
4. 帶進(jìn)度條的頁(yè)面跳轉(zhuǎn)代碼代碼:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>帶進(jìn)度條的頁(yè)面跳轉(zhuǎn)代碼</title>
</head>
<body>
<form name=loading>
<P align=center>
<FONT face=Arial color=#0066ff size=2>loading...</FONT>
<INPUT style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bolder; PADDING-BOTTOM: 0px; COLOR: #0066ff; BORDER-TOP-style: none; PADDING-TOP: 0px; FONT-FAMILY: Arial; BORDER-RIGHT-style: none; BORDER-LEFT-style: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-style: none" size=46 name=chart>
<BR>
<INPUT style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: #0066ff; BORDER-BOTTOM: medium none; TEXT-ALIGN: center" size=47 name=percent>
<SCRIPT>
var bar=0
var line="││"
var amount="││"
count()
function count(){
bar=bar+2
amount =amount + line
document.loading.chart.value=amount
document.loading.percent.value=bar+"%"
if (bar<99)
{setTimeout("count()",100);}
else
{window.location = "http://hi.baidu.com/jadmin";}
}
</SCRIPT>
</P>
</form>
</body>
</html>
其實(shí)很簡(jiǎn)單的,之前我卻琢磨了很久,具體方法如下:
找到Tomcat安裝目錄下的conf/web.xml文件中的代碼
????????? <init-param>
????????????? <param-name>listings</param-name>
????????????? <param-value>false</param-value>
????????? </init-param>
修改為:
????????? <init-param>
????????????? <param-name>listings</param-name>
????????????? <param-value>true</param-value>
????????? </init-param>
即可
Spring是一個(gè)開(kāi)源框架,它由Rod Johnson創(chuàng)建。它是為了解決企業(yè)應(yīng)用開(kāi)發(fā)的復(fù)雜性而創(chuàng)建的。Spring使用基本的JavaBean來(lái)完成以前只可能由EJB完成的事情。然而,Spring的用途不僅限于服務(wù)器端的開(kāi)發(fā)。從簡(jiǎn)單性、可測(cè)試性和松耦合的角度而言,任何Java應(yīng)用都可以從Spring中受益。