JavaµÄÓ¦ÓÃÓëStrutsµÄ³õ²½Á˽â
Õⲿ·ÖµÄÖ÷ÒªÄÚÈÝ£º
µÚÒ»£¬Java WebÓ¦Óûù´¡¸´Ï°
µÚ¶þ£¬MVCµÄÉè¼Æģʽ
µÚÈý£¬StrutsµÄÉè¼Æģʽ
µÚÒ»²¿·Ö£ºJava WebµÄÓ¦Óûù´¡
Java WebµÄºËÐļ¼ÊõÊÇJSPºÍServlet¼¼Êõ¡£
ͼһ£¬Java WebµÄÓ¦ÓõĽṹͼ
1£¬ServletÓëJSP
Servlet×é¼þÊÇÒ»¸öÓëÐÒéÎ޹صĿçƽ̨µÄ·þÎñÆ÷×é¼þ¡£ServletµÄ×÷ÓÃÊǶÁÈ¡¿Í»§·¢Ë͵ÄÏÔʾΪÊý¾Ý¡¢¶ÁÈ¡ÓÉä¯ÀÀÆ÷·¢Ë͵ÄÒþ²ØʽÇëÇóÊý¾Ý¡¢Ïò¿Í»§·¢ËÍÏÔʾÊý¾Ý¼°·¢ËÍÒþ²ØʽHTTPÏìÓ¦Êý¾ÝµÈ¡£¶øJSPÔò¸ºÔðÏÔʾÊý¾Ý£¬Ò²¾ÍÊǸºÔðÒ³ÃæÏÔʾ¡£
2£¬JavaBeanÔÚJava Web×é¼þµÄÓ¦ÓÃ
JavaBean·â×°ÊôÐԺͷ½·¨£¬Ê¹Ö®¾ßÓжÀÁ¢µÄ¹¦ÄÜ¡¢¿ÉÖØÓõIJ¢ÇÒÓëÆäËû¿Ø¼þͨѶµÄÀà¡£
ÒÔÏÂÊÇjsp¶ÔJavaBeanµÄ¼¸µãÓ¦Óá£
1£©<jsp:userBean>
¶¨Î»²¢ÊµÀý»¯Ò»¸öJavaBean¡£
<jsp:JavaBean id="user_page" scope="page" class="com.UserInfoBean"/>
ÆäÖУ¬idÊÇÀàµÄÓ³ÉäÃû³Æ£¬scopeΪ»á»°µÄÓÐЧ·¶Î§£¬classΪÀÛµÄÓ³Éä·¾¶
2£©<jsp:setProperty>
ÉèÖÃÒ»¸öJavaBeanµÄÊôÐÔ¡£
<jsp:setProperty name="user_age" property="user" value="<%=user_page.getUser()+1%>"></jsp:setProperty>
ÆäÖУ¬nameÖ¸¶¨ÁËJavabeanµÄ¶ÔÏó£»propertyÊôÐÔ±íÃ÷ÐèÒªÉ趨ֵµÄJavabeanÊôÐÔµÄÃû³Æ£»valueÊôÐÔ±íÃ÷ÁËÐèÒªÉ趨¸øJavabeanµÄÊôÐԵġ¿Öµ¡£
3£©<jsp:getProperty>
¶ÁÈ¡JavaBeanµÄÊôÐÔÖµ¡£
<jsp:getProperty name="user_page" property="user"/>
4)<jsp:include>
°üº¬Ò»¸öÒ³Ãæ
<jsp:include page="index.jsp" flush="true">
ÔÚÕâÀïÓеĵط½Òª×¢ÒâµÄ£¬ÄǾÍÊÇ
£¼%@ include file=”relativeURI”%£¾ ÊÇÔÚ·Òë½×¶ÎÖ´ÐÐ
£¼jsp:include page=”relativeURI” flush=”true” /£¾ ÔÚÇëÇó´¦Àí½×¶ÎÖ´ÐÐ.
1£© Ö´ÐÐʱ¼äÉÏ:
<%@ include file=”relativeURI”%> ÊÇÔÚ·Òë½×¶ÎÖ´ÐÐ
<jsp:include page=”relativeURI” flush=”true” /> ÔÚÇëÇó´¦Àí½×¶ÎÖ´ÐС£
2£©ÒýÈëÄÚÈݵIJ»Í¬:
<%@ include file=”relativeURI”%> ÒýÈ뾲̬Îı¾(html,jsp),ÔÚJSPÒ³Ã汻ת»¯³Éservlet֮ǰºÍËüÈں͵½Ò»Æð¡£ËùÒÔҪעÒâÁ½¸öÒ³ÃæÔÚÒýÓñäÁ¿Éϲ»ÒªÖظ´
<jsp:include page=”relativeURI” flush=”true” /> ÒýÈëÖ´ÐÐÒ³Ãæ»òservletËùÉú³ÉµÄÓ¦´ðÎı¾£¬ËùÒÔҪעÒâµÄÊÇÔÚ±»°üº¬µÄÒ³ÃæÉϲ»ÄÜÒýÓõ½µÚÒ»¸ö°üº
Ïà¹ØÎĵµ£º
JAVAºËÐļ¼Êõ¹Ûºó¸Ð
ÕâÖÜ´ó¼Ò¶¼»ù±¾ÉÏÂòÁËÒ»±¾¡¶JAVAºËÐļ¼Êõ¡·À´¿´£¬ËäÈ»ÎÒµÄÊéÏÂÖܲÅÄÜÄõ½£¬µ«ÊÇÎÒ»¹ÊÇ·ÁËϱðÈ˵ģ¬´óÖÂÁ˽âÁËÒ»ÏÂÀïÃæµÄÄÚÈÝ¡£ÒÔϾÍÊÇÎÒ´Ö²ÚµÄÕûÀí¡£
JAVA²¢²»Ö»ÊÇÒ»ÖÖÓïÑÔ£¬¶øÊÇÒ»¸öÍêÕûµÄƽ̨£¬ÓÐÒ»¸öÅÓ´óµÄ¿â£¬ÆäÖаüº¬ºÜ¶à¿ÉÒÔÖØÓõĴúÂëºÍÒ»¸öÌṩÖîÈ簲ȫÐÔ£¬¿ç²Ù×÷ϵͳµÄ¿ÉÒÆ ......
1, ±£Ö¤Ḭ̈߳²È«µÄÈýÖÖ·½·¨
:
a, ²»Òª¿çÏ̷߳ÃÎʹ²Ïí±äÁ¿
b, ʹ¹²Ïí±äÁ¿ÊÇ
finalÀàÐ͵Ä
c, ½«¹²Ïí±äÁ¿µÄ²Ù×÷¼ÓÉÏͬ²½
2, Ò»¿ªÊ¼¾Í½«ÀàÉè¼Æ³ÉḬ̈߳²È«µÄ
, ±ÈÔÚºóÆÚÖØÐÂÐÞ¸´Ëü
,¸üÈÝÒ×
.
3, ±àд¶àÏ̳߳ÌÐò
, Ê×ÏÈ
±£Ö¤ËüÊÇÕýÈ·µÄ
, Æä´ÎÔÙ¿¼ÂÇÐÔÄÜ
......
ÕâƪÎÄÕÂÎÒÊÇ´ÓIBMÍøÕ¾¿´µ½µÄ£¬ºÜÓÐÓ㬾ÍתÌû¹ýÀ´ÁË£¬ÔÎÄÍøÖ·ÊÇhttp://www.ibm.com/developerworks/cn/java/l-console/index.html£¬µ«ÊÇ´ò¿ªµÄʱºòÌرðÂý£¬¾ÍÔÚÕâÀïÕ³Ìùһϡ£
ÔÚJava¿ª·¢ÖУ¬¿ØÖÆ̨Êä³öÈÔÊÇÒ»¸öÖØÒªµÄ¹¤¾ß£¬µ«Ä¬ÈϵĿØÖÆ̨Êä³öÓÐן÷ÖÖ¸÷ÑùµÄ¾ÖÏÞ¡£±¾ÎĽéÉÜÈçºÎÓÃJava¹ÜµÀÁ÷½ØÈ¡¿ØÖÆ̨Êä³ö£¬·ÖÎö¹ÜµÀÁ ......
×î½üÒªÓÃjspÔÚÍøÒ³ÉÏÏÔʾͼ±íÇúÏߣ¬Íø²éÀ´²éÈ¥¾ÓȻûÓÐÎÒÏëÒªµÄ¶«Î÷£¬°¦£¡¿ÉÄܹØ×¢Õâ·½ÃæÓ¦ÓõÄÈËÌ«ÉÙÁË°É¡£²»¹ýÓÐÐÒÈÃÎÒÏÂÔØÁËTeeChart for java£¬ÄǸö½Ð¸ßÐËѽ£¬ÕæÏóÊÇÓöµ½ÁËÊ®¼¸Äêû¼ûµÄÀÏÓÑ¡£µ«ÍøÉÏÏà¹ØÖÐÎÄÎĵµ¡¢×ÊÁÏÌ«ÉÙ£¨¶¼ÊÇaspµÄ£©£¬Ã»°ì·¨£¬Ö»ºÃÓÃ×Ô¼º”¶þ°Ñµ¶“µÄÓ¢Óïˮƽ·Òë¿Ø¼þ°üÖÐ×Ô´øµÄ×ÊÁÏ£¬¸ãÁ ......
class EnclosingOne {
public class InsideOne {
}
}
public class B {
public static void main(String[] args) {
EnclosingOne eo = new EnclosingOne();
EnclosingOne.InsideOne ei = eo.new InsideOne();
}
} ......