JSPһЩ±êÇ©, ¶ÔÓ¦µÄ java´úÂë
1.
<jsp:useBran id="cb" class="bean.CounterBean" >
</jsp:useBean>
¶ÔÓ¦´úÂ룺 <%CounterBean cb = new CounterBean();%>
2.
<jsp:setProperty name ="cb" property="count" value = "23"/> ¶ÔÓ¦´úÂ룺
<%-- cb.setCount(Integer.paseInt("23"))- -%>
3.
<jsp:setProperty name ="cb" property="count" ¶ÔÓ¦´úÂ룺
<%-- out.print(cb.getCount())--%>
4.(Öصã) <jsp:useBean id = "counterBean"
scope = "request"
class = "bean.CounterBean" />
¶ÔÓ¦´úÂ룺
<% bean.CouterBean counterBean = (bean.CouterBean)request.getAttribute("counterBean");
if(counterBean = null){
counterBean = new bean.CounterBean();
request.SetAttribute("counterBean",counterBean)
Ïà¹ØÎĵµ£º
1 JDK5.0°üÀ¨µÄµ÷ÊÔ¹¤¾ß
ÎÒÃÇÔÚÕâÀï¶ÔJDK5.0µÄµ÷ÊÔ¹¤¾ß×ö´óÖµĸÅÄîÐԵĽéÉÜ£¬È»ºóÏ£Íûͨ¹ý½éÉÜÎÒ×Ô¼ºÔÚʵ¼Ê¹¤×÷ÖÐʹÓÃÕâЩ¹¤¾ß½â¾öÎÊÌâµÄʵÀýÀ´Èôó¼Ò¶ÔÕâЩ¹¤¾ßÓиüÉîÈëµÄÁ˽⡣
¡¡JDK5.0ÀïÃæ¼ÓÈëÁËjstack, jconsole, jinfo, jmap, jdb, jstat, jps, ÏÂÃæ¶ÔÕâЩ¹¤¾ß×ö¼òµ¥½éÉÜ£º
¡¡jstack -- Èç¹ûjava³Ì ......
Bean Serializable Interface µÄ½Ó¿ÚÈÃBEAN¿ÉÒÔ´®Ðл¯£¬½«Æä±ä³ÉÒ»¸ö¿É±£´æΪÒÔºóʹÓõĶþ½øÖÆÁ÷¡£µ±Ò»¸öBEAN±»ÏµÁл¯µ½´ÅÅÌÉÏ»òÕßÆäËûÈκεط½£¬Æä״̬±»±£´æÆðÀ´£¬ÆäÖеÄÊôÐÔÖµÒ²²»»á¸Ä±ä¡£ÔÚBEANµÄ¹æ·¶ÖУ¬JSP²¢Ã»ÓÐÒªÇóBEANʵÏÖSerializable½Ó¿Ú¡£µ«ÊÇ£¬Èç¹ûÄúÏ£Íû×Ô¼º¿ØÖÆÄúËù´´½¨µÄ×é¼þµÄserialization½ø³Ì£¬»òÕßÄúÏë ......
Java±à³ÌÄÇЩʶù52—·½·¨ÉùÃ÷
µÚÆßÕÂ ·½·¨
·½·¨µÄÀ´Ô´
·½·¨µÄ¸ÅÄîÀ´Ô´ÓÚÊýѧÉϵĺ¯Êý£¬ÔÚÊýѧÖУ¬µ±Êý¾Ý¾ßÓÐÒ»¶¨µÄ¹æÂÉʱ£¬¾ÍÊÇÓÃÒ»¸öº¯ÊýÀ´´úÂë¸ÃÊý×ֵĹæÂÉ£¬ÀýÈçf£¨n£©=nÔò´ú±í1¡¢2¡¢3¡¢……ÕâÑùµÄÒ»¸öÊýÁС£ÔÚÊýѧÉÏnÊDzÎÊý£¬¶ÔÓÚÈ·¶¨µÄnÖµÖ»ÓÐÒ»¸öf£¨n£©µÄÖµºÍËü¶ÔÓ¦
·½·¨ÊÇÒ»×éΪÁËʵÏÖÌض¨¹¦Ä ......
Ê×ÏÈһЩ±»³õʼ»¯¶ÔÏóµÄ¸ÅÄ
Àà±äÁ¿£¨Àྲ̬³ÉÔ±£©£º Àà±»¼ÓÔØʱ²úÉú£»ËüµÄÉú´æÆÚÊÇÀàµÄÉú´æÆÚ£»×Ô¶¯³õʼ»¯£¨Àà±»¼ÓÔØ£©
³ÉÔ±±äÁ¿£¨Àà³ÉÔ±£©£º ÔÚʹÓÃnew´´½¨¸ÃÀàʵÀýʱ²úÉú£»ËüµÄÉú´æÆÚÓë¸ÃÀàʵÀý¶ÔÏóµÄÉú´æÆÚÏàͬ£»
×Ô¶¯³õʼ»¯£¨¹¹Ôì·½·¨±»µ÷Óã©
¾Ö²¿±äÁ¿£¨ÀàµÄ·½·¨ÖеıäÁ¿£©£º ¸Ã·½·¨±»µ÷ÓÃÊ ......
package org.bupt.test;
import java.util.ArrayList;
class MyResource {
ArrayList<Integer> arrList= new ArrayList<Integer>();
public MyResource(ArrayList<Integer> arrList) {
this.arrList = arrList;
&nbs ......