scriptlet的使用
% %>的使用
html> head> title>this is java page/title> /head> body> !--顯示注釋 注釋內(nèi)容 --> % int x=10; int y=20; String str=request.getParameter("info"); out.println("h1>"+str+"/h1>"); out.println("h1>"+(x+1)+"/h1>"); out.println("h2>"+y+"/h2>"); %> /body> /html>
%! %>的使用
html> head> title>this is java page/title> /head> body> !--顯示注釋 注釋內(nèi)容 --> %! public static final int x=10; %> %! public int add(int x,int y) { return x+y; } %> %! class person { private String name; private int age; public person(String name,int age) { this.name=name; this.age=age; } public String toString() { return "name="+name+",age="+age; } } %> %! public int li=20; %> % person p=new person("test",10); out.println(p); out.println(li); out.println(add(x,20)); %> % int b=10; out.println(b); %> /body> /html>
%= %>的使用
html> head> title>this is java page/title> /head> body> !--顯示注釋 注釋內(nèi)容 --> % int x=10; int y=20; String str=request.getParameter("info"); %> %=x%> %=y%> %="strinsssa"%> /body> /html>
到此這篇關(guān)于jsp學(xué)習(xí)之scriptlet的使用方法詳解的文章就介紹到這了,更多相關(guān)jsp scriptlet 內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
標(biāo)簽:黃石 樂山 內(nèi)江 廣州 大連 貸款邀約 南京 銅川
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《jsp學(xué)習(xí)之scriptlet的使用方法詳解》,本文關(guān)鍵詞 jsp,學(xué),習(xí)之,scriptlet,的,使用方法,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。