锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲欧美中文,日韩精品久久一区二区三区,久久9热精品视频 http://www.aygfsteel.com/guohua/category/35390.htmljsp鍗氬 zh-cn Thu, 23 Oct 2008 06:51:14 GMT Thu, 23 Oct 2008 06:51:14 GMT 60 jsp鏍囩搴撶紪紼?/title> http://www.aygfsteel.com/guohua/archive/2008/10/22/236001.html閮叴鍗?/dc:creator>閮叴鍗?/author>Wed, 22 Oct 2008 11:20:00 GMT http://www.aygfsteel.com/guohua/archive/2008/10/22/236001.html http://www.aygfsteel.com/guohua/comments/236001.html http://www.aygfsteel.com/guohua/archive/2008/10/22/236001.html#Feedback 0 http://www.aygfsteel.com/guohua/comments/commentRss/236001.html http://www.aygfsteel.com/guohua/services/trackbacks/236001.html
絎旇涓嬭澆
浠g爜涓嬭澆鍦板潃錛?br />
/Files/guohua/TaglibProject.rar
hello.java
package org.lxh.demo01;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
public class Hello extends TagSupport {
@Override
public int doStartTag() throws JspException {
// 鍚慗SP欏甸潰涓墦鍗?#8220;www.mldn.cn”鐨勫瓧絎︿覆
String str = " www.mldn.cn " ;
// 鍦⊿ervlet閲屽鏋滆鎵撳嵃錛屽垯瑕佷嬌鐢≒rintWriter
// 濡傛灉鍦ㄦ爣絳懼簱涓墦鍗伴渶瑕佷嬌鐢╬ageContext
JspWriter out = pageContext.getOut() ;
try {
out.println(str);
} catch (IOException e) {
e.printStackTrace();
}
// 鍙鎵撳嵃瀹屼簡瀛楃浼狅紝鍒欏悗闈㈢殑浠g爜灝變笉闇瑕佹墽琛屼簡
return TagSupport.SKIP_BODY;
}
}
hello.jsp
<% @ page language = " java " import = " java.util.* " pageEncoding = " ISO-8859-1 " %>
<% @ taglib uri = " /WEB-INF/hello.tld " prefix = " lxh " %>
< html >
< head >
< title > My JSP ' hello.jsp ' starting page </ title >
<!--
< link rel = " stylesheet " type = " text/css " href = " styles.css " >
-->
</ head >
< body >
< h1 >< lxh:mldn /></ h1 >
</ body >
</ html >
helloxml.jsp
<% @ page language = " java " import = " java.util.* " pageEncoding = " ISO-8859-1 " %>
<% @ taglib uri = " /WEB-INF/hello.tld " prefix = " lxh " %>
< html >
< head >
< title > My JSP ' hello.jsp ' starting page </ title >
<!--
< link rel = " stylesheet " type = " text/css " href = " styles.css " >
-->
</ head >
< body >
< h1 >< lxh:mldn /></ h1 >
</ body >
</ html >
hello.tld
<? xml version = " 1.0 " encoding = " UTF-8 " ?>
<! DOCTYPE taglib PUBLIC " -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN " " web-jsptaglibrary_1_2.dtd " >
< taglib >
< tlib - version > 1.0 </ tlib - version >
< jsp - version > 2.0 </ jsp - version >
< short - name > hello </ short - name >
< tag >
< name > mldn </ name >
< tag - class > org.lxh.demo01.Hello </ tag - class >
< body - content > empty </ body - content >
</ tag >
</ taglib >
]]> SubStringTest.java http://www.aygfsteel.com/guohua/archive/2008/10/22/235926.html閮叴鍗?/dc:creator>閮叴鍗?/author>Wed, 22 Oct 2008 05:38:00 GMT http://www.aygfsteel.com/guohua/archive/2008/10/22/235926.html http://www.aygfsteel.com/guohua/comments/235926.html http://www.aygfsteel.com/guohua/archive/2008/10/22/235926.html#Feedback 0 http://www.aygfsteel.com/guohua/comments/commentRss/235926.html http://www.aygfsteel.com/guohua/services/trackbacks/235926.html
*閫氳繃榪欎釜紼嬪簭錛屽睍紺哄瓧絎︿覆姹傚彇瀛愪覆鐨勬柟娉?br />
*/
public class SubStringTest{
public static void main(String[] args){
String str="I am a Programmer";//瀹氫箟瀛楃涓?br />
for(int i=0;i<str.length();i++){
System.out.println("榪欐槸絎?+i+"涓瓙涓詫細"+str.subString(i));
}}}
]]> CommandInput.java http://www.aygfsteel.com/guohua/archive/2008/10/22/235839.html閮叴鍗?/dc:creator>閮叴鍗?/author>Wed, 22 Oct 2008 00:20:00 GMT http://www.aygfsteel.com/guohua/archive/2008/10/22/235839.html http://www.aygfsteel.com/guohua/comments/235839.html http://www.aygfsteel.com/guohua/archive/2008/10/22/235839.html#Feedback 0 http://www.aygfsteel.com/guohua/comments/commentRss/235839.html http://www.aygfsteel.com/guohua/services/trackbacks/235839.html
*鍛戒護琛屽弬鏁扮殑杈撳叆錛屼粠鍛戒護琛岃緭鍏ョ殑浠諱綍鍙傛暟錛屽浜巎ava鏉ヨ閮芥槸鐢ㄥ瓧絎︿覆澶勭悊鐨?br />
*/
public class CommandInput{
public static void main(String[] args){
if(args.length==0){
System.out.println("浣犳病鏈夎緭鍑哄弬鏁幫紝紼嬪簭閫鍑?);
}
else{
System.out.println("浣犱竴鍏辮緭鍏ヤ簡"+args.length+"涓弬鏁?);
if(args[0].equals("h"))
System.out.print("hello");
if(args[0].equals("g"))
System.out.print("Bye-Bye");
for(int i=1;i<args.length;i++)
{
System.out.print(" "+args[i]);
}
}
}
}
]]> ArraySort.java http://www.aygfsteel.com/guohua/archive/2008/10/22/235837.html閮叴鍗?/dc:creator>閮叴鍗?/author>Tue, 21 Oct 2008 23:49:00 GMT http://www.aygfsteel.com/guohua/archive/2008/10/22/235837.html http://www.aygfsteel.com/guohua/comments/235837.html http://www.aygfsteel.com/guohua/archive/2008/10/22/235837.html#Feedback 0 http://www.aygfsteel.com/guohua/comments/commentRss/235837.html http://www.aygfsteel.com/guohua/services/trackbacks/235837.html
*鏁扮粍鎺掑簭鍙婇殢鏈烘暟鐨勪駭鐢?br />
*/
import java.util.Arrays;
import javax.swing.*
public class ArraySort{
public static void main(String[] args){
String strIn=JoptionPane.showInputDialog("璇瘋緭鍏ュ伐鍏卞灝戜釜褰╃悆錛?);
String strOut=JOptionPane.showInputDialog("璇瘋緭鍏ラ渶鎶藉彇澶氬皯涓僵鐞冿細");
int in=Integer.parseInt(strIn);
int[] total=new int[in];//鐢熸垚褰╃悆鎬繪暟鏁扮粍
for(int i=0;i<in;i++){
total[i]=i+1;
}
int[] out=new int[Integer.parseInt(strOut)];
for(int i=0;i<out.length;i++){
int r=(int)Math.random()*in;//浜х敓闅忔満鍏冪礌搴忓垪鍙?br />
out[i]=total[r];
total[r]=total[in-1];//灝嗘渶鍚庝竴涓厓绱犵Щ鍒板綋鍓嶄綅緗紝鎶婂彇鍑虹殑鍒犻櫎
in--;
System.out.print(" "+out[i]);}
Arrays.sort(out);
System.out.println("鎶藉彇鐨勬暟瀛楁帓搴忓悗鏄細");
for (int i=0;i<out.length;i++){
System.out.print(" "+out[i]);
}
System.exit(0);
}}
]]> ArrayInitTest.java http://www.aygfsteel.com/guohua/archive/2008/10/22/235834.html閮叴鍗?/dc:creator>閮叴鍗?/author>Tue, 21 Oct 2008 22:30:00 GMT http://www.aygfsteel.com/guohua/archive/2008/10/22/235834.html http://www.aygfsteel.com/guohua/comments/235834.html http://www.aygfsteel.com/guohua/archive/2008/10/22/235834.html#Feedback 0 http://www.aygfsteel.com/guohua/comments/commentRss/235834.html http://www.aygfsteel.com/guohua/services/trackbacks/235834.html
*閫氳繃榪欎釜紼嬪簭錛屾祴璇曟暟緇勫厓绱犻粯璁ゅ?br />
*/
public class ArrayInitTest{
public static void main(String[] args)
{
ArrayInitTest aTest=new ArrayInitTest();
int[] a=new int[10];//澹版槑涓涓柊鐨勬暣鏁版暟緇勶紝騫惰祴鍊間笌涓涓柊鐨勬暟緇勫彉閲?br />
aTest.println(a);//杈撳嚭鏁扮粍鍏冪礌鍒版帶鍒跺彴
boolean[] c=new boolean[10];//澹版槑涓涓柊鐨勫竷灝旀暟緇?br />
aTest.pprintln(c);
}
public void printInt(int[] array){
System.out.println(" 鏁存暟鍨嬫暟緇勭殑闀垮害鏄?"+array.length);
for(int i=0;i<5;i++){
array[i]=i;
}
System.out.println(" 鏁扮粍涓殑姣忎釜鍏冪礌鏄細 ");
for(int i=0;i<array.length;i++){
System.out.println(" "+array[i]);//鎵撳嵃鍑烘暟緇勪腑鐨勬瘡涓涓厓绱?br />
}
System.out.println("\n******************************");
}
public void printString(String[] array){
System.out.println(" 瀛楃鍨嬫暟緇勭殑闀垮害鏄?"+array.length);
for(int i=0;i<5;i++){
array[i]="鍏冪礌"+i;
}
System.out.println(" 鏁扮粍涓殑姣忎釜鍏冪礌鏄細 ");
for(int i=0;i<array.length;i++){
System.out.println(" "+array[i]);//鎵撳嵃鍑烘暟緇勪腑鐨勬瘡涓涓厓绱?br />
}
System.out.println("\n****************************");
}
public void printBoolean(boolean[] array){
System.out.println(" 甯冨皵鍨嬫暟緇勭殑闀垮害鏄?"錛媋rray.legnth);
for(int i=0;i<5;i++){
if(i%2==0)
array[i]=true;
else
array[i]=false;
}
System.out.println(" 鏁扮粍涓殑姣忎釜鍏冪礌鏄? ");
for (int i=0;i<array.length;i++){
System.out.print(" "+array[i]);//鎵撳嵃鍑烘暟緇勪腑鐨勬瘡涓涓厓绱?br />
}
System.out.println("\n**********************************");
}}
]]> ArrayCopy.java http://www.aygfsteel.com/guohua/archive/2008/10/21/235776.html閮叴鍗?/dc:creator>閮叴鍗?/author>Tue, 21 Oct 2008 13:13:00 GMT http://www.aygfsteel.com/guohua/archive/2008/10/21/235776.html http://www.aygfsteel.com/guohua/comments/235776.html http://www.aygfsteel.com/guohua/archive/2008/10/21/235776.html#Feedback 0 http://www.aygfsteel.com/guohua/comments/commentRss/235776.html http://www.aygfsteel.com/guohua/services/trackbacks/235776.html
*嫻嬭瘯鏁扮粍鍏冪礌鐨勬嫹璐?br />
*/
public class ArrayCopy{
public static void main(String[] args){
ArrayCopy aCopy=new ArrayCopy();
int[] a={1,2,3,4,5};
int[] b={10,20,30,40,50};
aCopy.copy(a,b);
}
public void copy(int[] from,int[] to){
System.out.println("絎竴涓暟緇勪腑鐨勫厓绱?);
for(int i=0;i<from.length;i++){
System.out.println(" "+from[i]);
}System.out.println("\n");
System.out.println("絎簩涓暟緇勪腑鐨勫厓绱?);
for(int i=0;i<to.length;i++){
System.out.println(" "+to[i]);//鎵撳嵃鍑烘暟緇勪腑鐨勬瘡涓涓厓绱?br />
}
System.out.println("\n\n灝嗙涓涓暟緇勬嫹璐濆埌絎簩涓暟緇刓n");
System.arraycopy(from,2,to,0,3);
System.out.println("鎷瘋礉瀹屾垚鍚庣浜屼釜鏁扮粍涓殑鍏冪礌");
for(int i=0;i<to.length;i++){
System.out.println(" "+to[i]);//鎵撳嵃鍑烘暟緇勪腑鐨勬瘡涓涓厓绱爙}}
]]>
主站蜘蛛池模板:
安塞县 |
满城县 |
平昌县 |
太湖县 |
河西区 |
巩留县 |
苍溪县 |
遂平县 |
申扎县 |
喀喇沁旗 |
珠海市 |
安泽县 |
郓城县 |
乌兰县 |
乡宁县 |
滦南县 |
营山县 |
历史 |
班玛县 |
招远市 |
曲松县 |
龙门县 |
麻江县 |
兖州市 |
米易县 |
五莲县 |
铁岭市 |
高台县 |
个旧市 |
光山县 |
安岳县 |
呼伦贝尔市 |
义马市 |
交口县 |
得荣县 |
海兴县 |
齐齐哈尔市 |
马尔康县 |
定州市 |
广丰县 |
西安市 |