JSP鐠囶厽纭舵禒瀣矝 鐠囶厽纭剁拠锕佇� jsp濮瑰鐡х紓鏍垳闂傤噣顣界粵鏍殣 javamail閸︹啑SP娑擃厾娈戞惔鏃傛暏 javamail娴f洖绻斿铏圭槖 JDBC缁崘顩� jsp閸︹暢in2k/oracle娑撳﹦娈戞惔鏃傛暏 婵″倷缍嶉悽鈺慚L娑撶瘮SP瀵ょ儤膩 闁氨鏁ゆ穱鈩冧紖閸欐垵绔风粙瀣碍 JSP濮掑倽鍫崣濠囩叾娑旀劕绨电拋鎹愵吀 jsp鐠佲剝鏆熼崳銊ュ煑娴o拷 娑撳秶鏁dbc閻╁瓨甯存潻鐐村复SQL Server jsp閻ㄥ嫬鍤柨娆忣槱閻烇拷 jsp閻ㄥ墜ap鎼存梻鏁� jsp鐎圭偟骞囩拹顓犲⒖缁嬪绨� 閻⑩暒sp缂傛牕鍟撻弬鍥︽娑撳﹨娴� 閻⑩暒spsmart Bean鐎圭偟骞囬弬鍥︽娑撳﹨娴� 閻⑩暒sp鏉╃偞甯磎ySQL閺佺増宓佹惔锟� 閸╃儤婀伴崘鍛枂缂佸嫪娆� JavaBean鐠嬪啰鏁ょ粈杞扮伐 JDBC鎼存梻鏁ょ粈杞扮伐 娑撯偓娑擃亪鈧氨鏁ら惃鍕)閸橈拷 JSP閹垛偓瀹秆囨肠闁匡拷(娑撯偓) 濞翠焦鏌熷▔鏇☆嚢閸愭瑦鏋冩禒锟� 閺傚洣娆㈡径鍕倞-鐠囪鍟撴潻钘夊 閺佺増宓佹惔鎾诡唶瑜版洖鍨庢い鍨▔缁€锟�
|
一个用JSP做的日历
发信站: 武汉白云黄鹤站 (Thu Jul 6 15:02:09 2000)
发信人: wildfield (Java), 信区: Java
是我刚做的,这种东西大家都用得着。我把他贴出来大家看看。
<!-- File name:calendar.jsp -->
<!-- 显示任意年、月的日历,可选择不同的年、月。
author:wildfield -->
<%@ page language="java" import="java.util.*" %>
<%! String year;
String month;
%>
<% month=request.getParameter("month");
year =request.getParameter("year");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>日</title>
<script Language="JavaScript">
<!--
function changeMonth()
{
var mm="calendar.jsp?month="+document.sm.elements[0].selectedIndex+"&year="
+<%=year%>;
window.open(mm,"_self");
}
//--></script>
</head>
<%! String days[]; %>
<%
days=new String[42];
for(int i=0;i<42;i++)
{
days="";
}
%>
<%
Calendar thisMonth=Calendar.getInstance();
if(month!=null&&(!month.equals("null")))
thisMonth.set(Calendar.MONTH, Integer.parseInt(month) );
if(year!=null&&(!year.equals("null")))
thisMonth.set(Calendar.YEAR, Integer.parseInt(year) );
year=String.valueOf(thisMonth.get(Calendar.YEAR));
month=String.valueOf(thisMonth.get(Calendar.MONTH));
thisMonth.setFirstDayOfWeek(Calendar.SUNDAY);
thisMonth.set(Calendar.DAY_OF_MONTH,1);
int firstIndex=thisMonth.get(Calendar.DAY_OF_WEEK)-1;
int maxIndex=thisMonth.getActualMaximum(Calendar.DAY_OF_MONTH);
for(int i=0;i<maxIndex;i++)
{
days[firstIndex+i]=String.valueOf(i+1);
}
%>
<body>
<FORM name="sm" method="post" action="calendar.jsp">
<%=year%>年 <%=Integer.parseInt(month)+1%>月
<table border="0" width="168px" height="81px">
<div align=center>
<tr>
<th width="25px" height="16px" bgcolor="#FFFF00"><font color="red">日</font>
</th>
<th width="25px" height="16px" bgcolor="#FFFF00">一</th>
<th width="25px" height="16px" bgcolor="#FFFF00">二</th>
<th width="25px" height="16px" bgcolor="#FFFF00">三</th>
<th width="25px" height="16px" bgcolor="#FFFF00">四</th>
<th width="25px" height="16px" bgcolor="#FFFF00">五</th>
<th width="25px" height="16px" bgcolor="#FFFF00"><font color="green">六</fon
t></th>
</tr>
<% for(int j=0;j<6;j++) { %>
<tr>
<% for(int i=j*7;i<(j+1)*7;i++) { %>
<td width="15%" height="16px" bgcolor="#C0C0C0" valign="middle" align="ce
nter">
<a href="jump.jsp?year=<%=year%>&month=<%=Integer.parseInt(month)+1%>&d
ate=<%=days[i]%>" target="main"><%=days[i]%></a></td>
<% } %>
</tr>
<% } %>
</div>
</table>
<table border="0" width="168px" height="20px">
<tr>
<td width=30%><select name="month" size="1" onchange="changeMonth()" >
<option value="0">一月</option>
<option value="1">二月</option>
<option value="2">三月</option>
<option value="3">四月</option>
<option value="4">五月</option>
<option value="5">六月</option>
<option value="6">七月</option>
<option value="7">八月</option>
<option value="8">九月</option>
<option value="9">十月</option>
<option value="10">十一月</option>
<option value="11">十二月</option>
</select></td>
<td width=28%><input type=text name="year" value=<%=year%> size=4 maxlength
=4></td>
<td>年</td>
<td width=28%><input type=submit value="提交"></td>
</tr>
</table>
</FORM>
<script Language="JavaScript">
<!--
document.sm.month.options.selectedIndex=<%=month%>;
//-->
</script>
</body>
</html>
※ 修改:.wildfield 于 Jul 6 15:12:37 修改本文.[FROM: sicimage.hust.ed]
|