Douyu»áÊÇSSH¹¹¼ÜÓëJSP/Servlet¼¼ÊõµÄÖÕ½áÕßÂð?
DouyuÊÇÒ»ÖÖÍêÈ«²ÉÈ¡JavaÓïÑÔ¿ª·¢µÄ¡¢ÔË×÷ÓÚJVMÒÔÉϵÄÐÂʽ»ù´¡¿ª·¢Æ½Ì¨¡£
ÔÚweb²ã£¬DouyuÍêÈ«ÒÅÆúÁËJSP/Servlet£¬
ÔÚÊý¾Ý¿â·ÃÎʲ㣬Douyu²»ÒÀÀµÓÚÈκÎORM(¶ÔÏñ¹ØϵÕÕÉä)¹¹¼Ü(ÈçHibernate)¡£
Douyu½«JavaÓïÑÔ±àÒëÆ÷¡¢Http·þÎñÆ÷¡¢MVCÔ²Âúµ÷ÕûÔÚÒ»Æð£¬
²îµã¶ù¶ÒÏÖÁËORMÈ«×Ô¶¯»¯£¬Í¬Ê±ÔÚJavaÓïÑÔ²ãÃæÒý³öÁËȨÏÞÖÎÀíÄ£ÐÍ¡£
DouyuÄÚÖõÄJavaÓïÑÔ±àÒëÆ÷»ùÓÚOpenJDK Javac±àÒëÆ÷(b60°æ)£¬
²¢½øÐÐÁËÅú¸ÄºÍÀ©ÕÅ£¬ºÍHttp·þÎñÆ÷×éºÏÒÔºóÄÜÔÚ¿ØÖÆÆ÷²ã·¢»Ó³öÇ¿´óµÄÍþÁ¦£¬
ÄãÖ»ÒªÅú¸ÄJavaÔ´Îļþ£¬ÆäºóË¢ÐÂä¯ÀÀÆ÷¾ÍÄܲ鿴ÔË×÷½á¹û£¬
Óë´Ëͬʱ±àÒëÆ÷Ò²ÊǶÒÏÖORM×Ô¶¯»¯µÄ»ùʯ¡£
DouyuÄÚÖõÄHttp·þÎñÆ÷ÊÇ»ùÓÚNIO¼¼ÊõµÄ£¬
ÊǶÔTomcatÁù¼°com.sun.net.httpserver(Ò»¹²1300¶à¸öJavaÔ´Îļþ)½øÕ¹À«¸«´óµ¶µÄ¸Ä½¨ºóµÃÀ´µÄ£¬
¸Ä½¨ºóµÄHttp·þÎñÆ÷µ±Ç°Î¨ÓÐ60¸öÉÏϵÄÔ´Îļþ£¬Ö§³ÖHttp1.0/1.1ÐÒé¡£
DouyuÄÚÖõÄȨÏÞÖÎÀíÄ£ÐÍÏֽ׶ΰüÔÐÁËЧÄÜȨÏÞ¡¢×Ö¶ÎȨÏÞÁ½À࣬
ЧÄÜȨÏÞÕý³£¶ÔÓ¦¿ØÖÆÆ÷ÀàÖеÄAction²½Ö裬Action²½Öè¿ÉÒÔÓë±íµ¥ÖеÄÐýÅ¥ÁªÏµ¹Øϵ£¬
×Ö¶ÎȨÏÞÄÜͳÖÆ±íµ¥ÖеÄ×Ö¶ÎÊDz»ÊÇ¿ÉÒԲ鿴¡¢Åú¸Ä»òÑڲء£
DouyuÄÚÖõÄORMÒѲîÒ»µã¶ÒÏÖ×Ô¶¯»¯£¬ÄãÖ»Ð뽨¸öÊý¾Ý¿â±í(Èçpet)£¬
ÆäºóÔÚ·þÎñÆ÷ÅäÖÃÎļþÖÐÅ䱸Êý¾Ý¿âÇý¶¯¡¢²¢ÎªÃ¿¸öÊý¾Ý¿âÖ¸¶¨Ò»¸ö°üÃû(Èçmy.oracle.table)£¬
È»ºó¾ÍÄã¿ÉÒÔÔÚÄãµÄJavaÔ´Îļþ¶¥ÓÃimport my.oracle.table.Petµ¼ÈëÄ£ÐÍÖÖPet¡£
Douyu»¹Ö§³Öºá¿ç¶à¸öÊý¾Ý¿âµÄÊÂÒË£¬»¹Ö§³Ö·â´æµã(Savepoint)¡£
DouyuÏîÄ¿Ê×Ò³Ïֽ׶ηÅÔÚ:
http://code.google.com/p/douyu/
µ×ÏÂÊÇһЩ¼òÂԵĴúÂëƬ¶Î:
Hello World
Java´úÂë
1.@Controller
¶þ.public class HelloWorld {
3. public void index(PrintWriter out) {
4. out.println("Hello World!");
5. }
6.}
@Controller
public class HelloWorld {
public void index(PrintWriter out) {
out.println("Hello World!");
}
}
×Ô¶¯ÌáÈ¡±íµ¥²ÎÊý:
Html´úÂë
1.
2. Ãû³Æ:
3. Äê¼Í:
4.
5.
Ãû³Æ:
Äê¼Í:
Java´úÂë
1.@Controller
¶þ.public class User {
3. public void show(String name, int age) {
4. ...
5. }
6.}
@Controller
public class User {
public void show(String name, int age) {
...
}
}
×ÊÁÏÉÏ´«
Html´úÂë
1.
2. ×ÊÁÏÒ»:
Èý.˵Ã÷ :
4.
5.
×ÊÁÏÒ»:
˵Ã÷ :
Java´úÂë
Ò».import com.do
Ïà¹ØÎĵµ£º
1.н¨Ò»¸öexcelÎļþ Ãû×ÖËæ±ã À©Õ¹Ãû .xls
2.µÚÒ»ÐÐÊDZíÍ· дÉÏÁÐÃû Èç id pwd
ÏÂÃæ¾ÍÊÇдÊý¾ÝµÄµØ·½
Ñ¡ÖÐÒ»¶ÎÇøÓò Èçͼ
²Ëµ¥ ²åÈë--Ãû³Æ--¶¨Òå
È¡¸öÃû×Ö µãÌí¼Ó Õâ¸öÃû×Ö¾ÍÊDZíÃû
3.ÉèÖÃÊý¾ÝÔ´
ϵͳDSN--Ìí¼Ó-- ......
1ÔõÑù¸Ä±ämyeclipseĬÈϵÄjsp ´ò¿ª·½Ê½
preferences->General->editors£>Files Associations£¨Î»Öøù¾Ý¾ßÌåeclipse°æ±¾»áÓÐËù²»Í¬£© File Types Ñ¡Ôñ.jsp assiciations ÀïÑ¡ÔñMyEclipse jsp editor£¬È»ºóµãÓұߵÄdefault
2,ÉèÖÃMyEclipse ×ÖÌå´óС
ÔÚwindow->perferences->General->Appearance-> ......
ÐèÒª¼ÇסµÄ֪ʶµã£º
1 ÇëÇóÓ¦´ðģʽ£¬¿Í»§¶Ë·¢ËÍÇëÇ󣬷þÎñÆ÷½øÐÐÏìÓ¦
2 JSPÎļþÊÇÔÚ·þÎñÆ÷¶ËÖ´ÐеÄ
3 ·µ»Ø¸ø¿Í»§¶ËµÄ½á¹ûÊÇJSPÎļþÖ´ÐеĽá¹û£¬²»°üº¬ÈκÎJSPÓï·¨
4 ÄÚ²¿¶ÔÏóÊÇÔÚ°ÑJSPÎļþת»»ÎªJava´úÂëµÄʱºòÉú³ÉµÄ
5 Ö´ÐеIJ¢²»ÊÇJSPÎļþ±¾Éí£¬¶øÊÇJSPת»»³ÉµÄJavaÀàµÄ¶ÔÏóµÄ·½·¨£¬ËùÒÔÓÐʱºòÐÞ¸ÄJSPÎļþ² ......
±¾ÎÄ×÷ÕߣºØýÃû
ËùÊô·ÖÀࣺÍøÂç±à³Ì
¼ÓÈëʱ¼ä£º2006-1-19
µã»÷´ÎÊý£º396
<%@ page language="java" contentType="text/html" %>
<%@ page import="com.ora.jsp.util.*" %>
<html>
<body bgcolor="white">
<form action="checkbox.jsp">
<input type="checkbox" name="fr ......
½ñÌìÕûÀíÏîÄ¿µÄÁ÷³Ì£¬ÔÚJSPºÍServletÖ®¼äÌøÀ´ÌøÈ¥£¬Ôø¾Ò»¶Îʱ¼ä£¬ÎÒ¶¼ÊÇ°ÑServlet·¾¶¶¨ÒåΪ¡°/SomeServlet¡±£¬Ò²¼´¶¨ÒåΪ¸ùĿ¼£¬ÒòΪ¼æÈÝÐԱȽϺ㬵«ÊÇÓÃÁËMyEclipseÖ®ºó£¬Ð½¨µÄServletĬÈÏ·¾¶ÊÇ¡°/servlet/SomeServlet¡±£¬ÕâÑùд±ãÓÚ¹ÜÀí£¬ÁíÍâ¾ÍÊǸüÊʺϵ¥¶ÀΪServletÉèÖÃFilter£¨¹ØÓÚFilterµÄÉèÖÿÉÒԲο¼ ......