FreeBSD 7.0 °²×°ÅäÖÃJSP»·¾³apache+apache
ÎÒÏÈ˵Ã÷Ò»ÏÂÅäÖû·¾³µÄ´ó¸ÅÇé¿ö£º
* FreeBSD 7.0-RELEASE
* apache-2.2.9
* mod_jk-ap2-1.2.26
* diablo-jdk-1.6.0.07.02
* tomcat-6.0.16
¾ßÌåµÄ°æ±¾ÐÅÏ¢ÏÔʾÈçÏ£º
freebsd# pkg_info
apache-2.2.9_5 Version 2.2.x of Apache web server with prefork MPM.
apache-tomcat-6.0.16 Open-source Java web server by Apache, 6.x branch
diablo-jdk-1.6.0.07.02 Java Development Kit 1.6.0_07.02
mod_jk-ap2-1.2.26 Apache2 JK module for connecting to Tomcat using AJP1X
ºÃ£¬À´¿´¿´¾ßÌåµÄ×ö·¨°É£¡
µÚÒ»²½£º°²×°FreeBSD£¬²ÉÈ¡×îС»¯°²×°µÄ²½Ö裬Ëæ±ã°Ñports¸ø×°ÉÏ°É£¬·½±ãÖ±½Ó°²×°±ØÒªµÄports¡£
ÕâÀïûÓÐʲôÌرðµÄµØ·½£¬Ö»ÊÇÌáÐÑһϣ¬°²×°Íê³Éºó×¢ÒâÒª¸üе½×îеÄports tree £¡
ÓÉÓÚÊÇ×îС»¯°²×°£¬ËùÒÔÐèҪͨ¹ýports°²×°ÏÂÃ漸¸öpackage£º
* csup(cvsupµÄ°æ±¾)
* portupgrade
Íê³É°²×°ºó£¬¸üÐÂports tree£¬ÎÒʹÓÃÁËcvsup.FreeBSDChina.org ×÷Ϊ¾µÏñ£¡
µÚ¶þ²½£º°²×° JDK £FreeBSD ·¢²¼µÄ JDK 1.6 Èí¼þ°ü
´ÓportsÀ´±àÒëJDK£¡
2.1 ½ø /usr/ports/java/diablo-jdk16 £¬make£¬ÌáʾÏÂÔØjdkÎļþ£¨diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2£©µ½ /usr/ports/distfiles Ï£¬
ͨ¹ýbrower µ½ http://www.FreeBSDFoundation.org/cgi...07-b02.tar.bz2
ÏÂÔØ£¬ÐèÒªagree¡£
×¢£º Ò²¿ÉÒÔÏÂÔØdiablo-jdk-freebsd7.i386.1.6.0.07.02.tbzÎļþµ½/usr/ports/distfilesĿ¼ÏÂÈ»ºó pkg_add ¼´¿É
°²×°Ê±£¬ÐèÒª°²×°javavmwrapper-2.3.2.tbz¡£ÏÂÔØÖ®ºó·Åµ½/usr/ports/distfilesĿ¼Ï£¬°²×°diablo-jdk-freebsd7.i386.1.6.0.07.02.tbzʱ£¬»á×Ô¶¯°²×°¡£
2.2 make all install clean
2.3 ¼ì²é°²×°
freebsd# /usr/local/diablo-jdk1.6.0/bin/java -version
java version “1.6.0_07″
Diablo Java(TM) SE Runtime Environment (build 1.6.0_07-b02)
Diablo Java HotSpot(TM) Client VM (build
Ïà¹ØÎĵµ£º
£±.×îÖ±½Ó×î¼òµ¥µÄ£¬·½Ê½ÊÇ°ÑÎļþµØÖ·Ö±½Ó·Åµ½htmlÒ³ÃæµÄÒ»¸öÁ´½ÓÖС£ÕâÑù×öµÄȱµãÊÇ°ÑÎļþÔÚ·þÎñÆ÷ÉϵÄ·¾¶±©Â¶ÁË£¬²¢ÇÒ»¹ÎÞ·¨¶ÔÎļþÏÂÔؽøÐÐÆäËüµÄ¿ØÖÆ£¨ÈçȨÏÞ£©¡£Õâ¸ö¾Í²»Ð´Ê¾ÀýÁË¡£
£².ÔÚ·þÎñÆ÷¶Ë°ÑÎļþת»»³ÉÊä³öÁ÷£¬Ð´Èëµ½response£¬ÒÔresponse°ÑÎļþ´øµ½ä¯ÀÀÆ÷£¬ÓÉä¯ÀÀÆ÷À´ÌáʾÓû§ÊÇ·ñÔ¸Òâ±£´æÎ ......
ÀÊÎÖ½ÌÓý³É¶¼¼ÆËã»úÅàѵ-JSPƪ
J2EE(Java 2 Enterprise Edition)¼¼ÊõÒѹ㷺ӦÓÃÔÚWebÓ¦Óÿª·¢ÖУ¬ÆäÖеÄJavaBean¡¢Servlet¼¼ÊõΪ¿ª·¢ÕßÌṩÁ˸üΪÇåÎúµÄ¿ª·¢»·¾³£¬Ê¹ÓÃJSP¼¼Êõ±íÏÖÒ³Ã棬ʹÓÃServlet¼¼ÊõÍê³É´óÁ¿µÄÒµÎñ´¦Àí£¬Ê¹ÓÃBeanÀ´´æ´¢Êý¾Ý¼°Ò»Ð©ÒµÎñ´¦Àí¡£ÔÚWEBÓ¦ÓÃÖУ¬ÒµÎñÊý¾Ý´æ´¢µ½Êý¾Ý¿âÖеĴ¦Àí¹¤×÷¾³£ºÜ·±ÖØ£¬ ......
ѧϰJSPÖ÷ҪѧϰËûµÄ9´ó¶ÔÏó(request, response, pageContext, session, application, out, config, page, exception ),ÕâЩ¶ÔÏó¶¼ÊǾ²Ì¬¶ÔÏ󣬲»Óö¨Òå¾Í¿ÉÒÔÖ±½ÓʹÓ㬰ÑËûÃǶ¼Á˽âÇå³þ²¢»áÔËÓ㬾ͿÉÒÔÔÚ¼òÀúÉÏÌíÉÏÒ»¸öÊìϤ¼¼ÄÜ:JSP
JspÄÚÖöÔÏó ¹¦ÄÜ Ö÷Òª·½·¨
out Ïò¿Í»§¶ËÊä³öÊý¾Ý print() println() flush() ......
index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......
ÒÔÇ°ÓÃWSAD wizard×öµÄ£¬¶¼¿ÉÒÔÔÚJSPÒ³ÃæÖнâÎöµ½EL±í´ïʽ£¬µ±È»Ç°ÌáÊÇJSP2.0µÄÇé¿öÏ¡£
½ñÌìÓöµ½ÁËÒ»¸öĪÃûÆäÃîµÄÎÊÌâ¡£¸ÕÏÂÔØEclipse3.3+MyEclipse6.0ÌåÑéµÄ¹ý³ÌÖУ¬ÓöÉÏÁ˽âÎö²»µ½EL±í´ïʽµÄÎÊÌâ¡£¾¹ýºÃ¼¸¸öСʱµÄ×ÁÄ¥ÖÕÓÚ·¢ÏÖÁË£¬¸ø´ó¼Òshareһϣº
ÎÊÌâ¾Í³öÔÚ½¨Web ProjectµÄʱºòweb.xmlÉùÃ÷ÉÏ¡£
web.xml ......