|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
自己的整个学习思路完全被老师的讲课思路所牵制,这样几节课听下来,恐怕自己的见解都应该是书里的知识点了,根本谈不上自身发现问题,分析问题,和解决问题能力的切实提高。条记Bean标签库
1.<bean:header>#0968F7
<bean:headerid="custlang"name="Accept-Language"/>
Here:<bean:writename="custlang"/>
=>
Here:zh-cn,en-us;q=0.5
2.<bean:parameter>
<bean:parameterid="bookId"name="id"value="0"/><%--value是默许值-%>
哀求的图书编号为:<bean:writename="bookId"/>
=>
哀求的图书编号为:8<!--http://localhost/AddressBook/MyJsp.jsp?id=8-->
<bean:parameterid="custNames"multiple="true"name="names"value="hehe"/>
哀求的客户姓名有:<p/>
<%
for(inti=0;i<custNames.length;i++){
out.print(custNames[i]+"__");
}
%>
=>
哀求的客户姓名有:<p/>
cheyo__vsftpd__Google__
3.<bean:cookie>
Cookies:<bean:cookieid="customer"name="custName"value="cheyo"/>
您好,<bean:writename="customer"property="value"/>
=>
Cookies:
您好,cheyo
4.<bean:page>
<bean:pageid="currSession"property="session"/>
以后会话创立工夫:<bean:writename="currSession"property="creationTime"/>
=>
以后会话创立工夫:1111993122390
5.<bean:message>
<1>
<bean:messagebundle="test"key="test.name"/><p/>
<2>
<%
request.setAttribute("stringBean","test.nick");
%>
<bean:messagebundle="test"name="stringBean"/>
<3>
<%
SomeBeanbean=newSomeBean();
bean.setName("hello");
request.setAttribute("someBean",bean);
%>
<bean:messagebundle="test"name="someBean"property="name"/>
<4>
<bean:messagebundle="test"key="test.error"arg0="接洽地点!"/>
<!--test.error={0}isrequried!-->
6.<bean:resource>
以下为test页面的内容:<p/>
<bean:resourceid="testPage"name="test/testDS.jsp"/>
<bean:writename="testPage"/>
7.<bean:struts>
<bean:strutsid="successForward"forward="aaaa"/>
<bean:writename="successForward"property="path"/>
=>
/hello.jsp
8.<bean:include>
以下为include进的内容:<p/>
<bean:includeid="includeReg"forward="success"/>
<bean:writename="includeReg"filter="false"/>
<p/>
以下为include进的内容3:<p/>
<bean:includeid="includeReg"page="/hello.jsp"/><%--必定要以/开首--%>
<bean:writename="includeReg"filter="false"/>
9.<bean:define>
<1>
<bean:defineid="currDate"value="2005-03-28"/>
<bean:writename="currDate"/>
<2>
<%
Useruser=newUser();
user.setUserName("cheyo");
request.setAttribute("userBean",user);
%>
<bean:defineid="currUser"name="userBean"/>
以后用户姓名:<bean:writename="currUser"property="userName"/>
<%--注重:下面加下划线的"user"这一变量名不该与白色下划线的"currUser"这一变量名不异!不然会报错!-->
10.<bean:size>
<%
HashMaplines=newHashMap();
lines.put("1","line1");
lines.put("2","line2");
lines.put("3","line3");
request.setAttribute("lines",lines);
%>
<bean:sizeid="lineSize"name="lines"/>
线的数目:
<bean:writename="lineSize"/>
11.<bean:write>
<1>
<%
request.setAttribute("floatval",Float.valueOf("3.14159"));
Calendargc=GregorianCalendar.getInstance();
gc.setTime(newDate(session.getCreationTime()));
request.setAttribute("now",gc);
%>
Piis:<bean:writeformat="#.####"name="floatval"/><p/>
SessionStartedat:<bean:writeformat="MM-dd-yyyyhh:mm:ss"name="now"property="time"/>
<2>
<%
StringboldStart="<B>";
StringboldEnd="</B>";
request.setAttribute("bs",boldStart);
request.setAttribute("be",boldEnd);
%>
<bean:writename="bs"/>哈哈哈哈<bean:writename="be"/><p/><%--输入<B>哈哈哈哈</B>--%>
<bean:writename="bs"filter="false"/>加粗的哈哈哈哈<bean:writename="be"filter="false"/><p/>
=>
<B>哈哈哈哈</B><p/>
<B>加粗的哈哈哈哈</B><p/>
Java编译的是字节码,跟C++相反,启动不够快,效率不够高,难以精确控制内存,但是优点是编程比C++容易,代码比较安全但是容易留下性能隐患,跨平台靠字节码在各个平台复制(一处编译到处调试) |
|