Java Web µÚ9Ìì jsp
Ò»¡¢
ΪʲôҪʹÓÃ
JSP
ÔÚ¿Í»§¶ËÍøÒ³±à³ÌÖÐ
Java
µÄ½â¾ö·½°¸ÊÇ
Servlet/JSP
¡£¶ÔÓÚ¶¯Ì¬Ò³ÃæµÄÐγÉÎÒÃÇ¿ÉÒÔÀûÓÃÔÚ
Servlet
Öбàд×Ö·û´®ÊµÏÖ£¬µ«ÊÇÕâÑù»áʹ³ÌÐòÔ±µÄ¹¤×÷±äµÃÒì³£µÄ·±Ëö£¬ËùÒÔÎÒÃDzÉÓÃ
JSP
´ïµ½ÍøÒ³µÄ¶¯Ì¬ÏÔʾ¡£
¶þ¡¢
ʲôÊÇ
JSP
JSP
£¨
JavaServerPage
£©ºÍ
Servlet
ÊÇ
Java
ÖвúÉú¶¯Ì¬ÍøÒ³Ï໥²¹³äµÄ¼¼Êõ¡£ËüµÄÎļþÀ©Õ¹ÃûΪ
.jsp
£¬ÏÖÔÚµÄ
JSP
¹æ·¶ÊÇ
JSP2.0
¹æ·¶¡£
JSP
ʵ¼ÊÉÏÒ²ÊÇÒ»¸ö
Servlet
¡£
Èý¡¢
JSP
µÄÔËÐлúÖƺÍÉúÃüÖÜÆÚ
1.
µ±Ïò
JSP
·¢ËÍÇëÇóʱ£¬
WEB
ÈÝÆ÷½«
*.JSP
Ò³Ãæ×Ô¶¯·Òë
_*_.jsp.java
Îļþ£¬ÔÚ
tomcat
ÏÂÕâ¸ö
Java
Îļþ´úÂëλÓÚ
work
Ŀ¼Ï¡£
2.
web
ÈÝÆ÷½«´úÂë±àÒë³É×Ö½ÚÂëÎļþ£¬¼´
.CLASS
Îļþ£¬Õâ¸öÎļþÓë
.JAVA
Îļþ·ÅÔÚͬһ¸öĿ¼Ï¡£
3.
web
ÈÝÆ÷×°ÔØÉú³ÉеÄ
servlet
Àà¡£
4.
JSP
Ò³ÃæʵÀý»¯¡£
5.
JSP
Ò³Ãæ³õʼ»¯
6.
JSP
Ò³Ãæ·þÎñ½×¶Î
7.
JSP
Ïú»Ù
ËÄ¡¢
JSP
µÄÓï·¨¹æÔò
1.
×é³É
JSP
ÍøÒ³ÓÉÔªËغÍÄ£°åÊý¾Ý×é³É¡£ÆäÖÐÄ£°åÊý¾ÝÊÒ
JSP
µÄ¾²Ì¬²¿·Ö£¬ËüÊÇ
WEB
ÈÝÒײ»´¦ÀíÖ±½ÓÏÔʾµÄ²¿·Ö¡£
WEB
ÈÝÆ÷Ö§³ÖÁ½ÖÖ²»Í¬¸ñʽµÄ
JSP
Óï·¨£ºÆÕͨ¸ñʽºÍ
XML
¼æÈݸñʽ¡£ÆÕͨ¸ñʽÓï·¨ÊÇÉè¼Æ¸ø¿ª·¢Õß¿´µÄ£¬
XML
¼æÈÝ
S
¸ñʽÓï·¨ÊÇÉè¼ÆÓÃÀ´ÈÝÒ×±»¿ª·¢¹¤¾ßʹÓõġ£
2.
½Å±¾ÔªËØ
ÉùÃ÷£º
<%!
ÉùÃ÷
%>
£»ÉùÃ÷ºóµÄ·½·¨ºÍÊôÐÔÔÚ
WEB-INF_jspService()
Í⣬ÊÇÒ»ÖÖÈ«¾ÖµÄ·½·¨»òÊôÐÔ¡£
Scriplet
£º
<%
´úÂë
%>
£»
Scriplet
Ìṩֱ½Ó²åÈë
Java
´úÂ뵽ģ°åÊý¾ÝÖеķ½·¨¡£±àÒëºó
Scriplet
´úÂë³öÏÖÔÚ
_jspService()
ÖУ¬ÔÚÕâÖмäÉùÃ÷µÄ±äÁ¿Îª¾Ö²¿±äÁ¿¡£
½Å±¾±í´ïʽ
<%=
½Å±¾±í´ïʽ
%>
£º²»ÄÜʹÓ÷ֺÅÀ´×÷Ϊ½Å±¾±í´ïʽµÄ½áÊø·û¡£²»ÐèҪʹÓÃ
out.print()
·½·¨¡£
3.
×¢ÊÍ
JSP
×¢ÊÍ£º
<%--
×¢ÊÍÄÚÈÝ
--%>
£º·ÒëºóÔÚÍøÒ³µÄÔ´ÎļþÖÐÊÇ¿´²»µ½µ
Ïà¹ØÎĵµ£º
ËäÈ»ºÜÉÙÓõ½Í¬²½£¬³öÓÚ¸öÈËÐËȤ×ÔѧÁËһϡ£ÏÖ¶ÔJAVAÖеÄͬ²½ÊÕ¼¯Ñ§Ï°µÄ¶«Î÷×ܽáһϣ¬ÈÃ×Ô¼º¼¼ÊõµÄÌõÀí»¯£¬Äܹ»³ÁµíÏÂÀ´¡£
ͬ²½¾ÍÊÇ´®ÐÐʹÓÃһЩ×ÊÔ´.
JAVAÖÐsynchronized¹Ø¼ü×ÖÄܹ»×÷Ϊº¯ÊýµÄÐÞÊηû£¬Ò²¿É×÷Ϊº¯ÊýÄÚµÄÓï¾ä£¬Ò²¾ÍÊÇƽʱ˵µÄͬ²½·½·¨ºÍͬ²½Óï¾ä¿é¡£¼ÙÈçÔÙϸµÄ·ÖÀ࣬synchronized¿É×÷ÓÃÓÚinstance ......
javaµÃµ½µ±Ç°Ê±¼ä
Java»ù´¡ 2009-06-02 21:34:18 ÔĶÁ1289 ÆÀÂÛ0 ×ֺţº´óÖÐС
//String nowTime=new SimpleDateFormat("yyyyMMddHHmm").format(new java.util.Date());
//System.out.println(nowTime);
import java.text.Sim ......
import java.io.InputStream;
import org.apache.lucene.document.Document;
import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.TextRun;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.usermodel.SlideShow;
public Document getDocument(Index index, String ur ......
annotationʹÓÃ
2010Äê2ÔÂ11ÈÕ ÁɹúÅÖÅÖ
½ñÌì¿´annotation¹æ·¶£¬ÌؼǼÈçÏ£¬ÒÔ±ãÒÔºó²Î¿¼£¬Ò²¹©³õѧµÄÅóÓÑÃÇÒ»¸ö¿ÉÔËÐа¸Àý£¬Óв»Í×Ö®´¦£¬ÇëÖ¸ÕýÐ޸ģ»ÁíÍ⣬ÌرðÉùÃ÷£¬Èç¹ûתÔØ»òÕßÒýÓÃÇë×¢Ã÷³ö´¦¡£
½éÉÜ
AnnotationÊÇjava5ÐÂÌí¼ÓµÄÌØÐÔ£¬ annotationÊÇÒ»ÖÖÔªÊý¾ ......
ÔÎÄÒý×Ôhttp://hi.baidu.com/heyinjie/blog/item/608ee7108f1f4802203f2e35.html
´ò¸ö±È·½£ºÒ»¸öobject¾ÍÏñÒ»¸ö´ó·¿×Ó£¬´óÃÅÓÀÔ¶´ò¿ª¡£·¿×ÓÀïÓкܶ෿¼ä£¨Ò²¾ÍÊÇ·½·¨£©¡£ÕâЩ·¿¼äÓÐÉÏËøµÄ£¨synchronized·½·¨£©£¬ ºÍ²»ÉÏËøÖ®·Ö£¨ÆÕͨ·½·¨£©¡£·¿ÃÅ¿Ú·Å×ÅÒ»°ÑÔ¿³×£¨key£©£¬Õâ°ÑÔ¿³×¿ÉÒÔ´ò¿ªËùÓÐÉÏËøµÄ·¿¼ä¡£ÁíÍâÎÒ°ÑËùÓÐÏë ......