JSP»·¾³´î½¨Ö®JDKµÄ°²×°ÓëTomcatÅäÖÃ
JSP»·¾³´î½¨µÚÒ»²½¡¢°²×°JDK
1£©¡¢´Ó¹ÙÍøÏÂÔØ°²×°³ÌÐò£ºhttp://java.sun.com/javase/downloads/index.jspÖ»ÒªÏÂÔØÆäÖÐÖ®Ò»°²×°¾Í¿ÉÒÔÁË
2£©¡¢°²×°JDK°ü
[root@linuxas src]cd /usr/local/src [root@linuxas src]# chmod u+x jdk-6u14-linux-i586.bin [root@linuxas src]#./jdk-6u14-linux-i586.bin
ÊäÈëyes £¬µÈ´ý°²×°Íê³É
[root@linuxas src]# rm -f jdk-6u14-linux-i586.bin [root@linuxas src]# ls apache-tomcat-6.0.20.tar.gz jdk1.6.0_14 [root@linuxas src]# pwd /usr/local/src [root@linuxas src]# cd jdk1.6.0_14/ [root@linuxas jdk1.6.0_14]# ls bin jre README_ja.html sample COPYRIGHT lib README_zh_CN.html src.zip db LICENSE register.html THIRDPARTYLICENSEREADME.txt demo man register_ja.html include README.html register_zh_CN.html [root@linuxas jdk1.6.0_14]# pwd /usr/local/src/jdk1.6.0_14
3£©ÉèÖû·¾³±äÁ¿
[root@linuxas lib]# vi /etc/profile
Ìí¼ÓÒÔÏÂÄÚÈÝ
export JAVA_HOME=/usr/local/src/jdk1.6.0_14 export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin: $PATH exportCLASSPATH=.:/usr/local/src/jdk1.6.0_14/lib:/usr/local/src/jdk1.6.0_14/jre/lib:$CLASSPATH
4£©¡¢ÑéÖ¤JAVA°²×°½á¹û
[root@linuxas ~]# source /etc/profile [root@linuxas ~]# java -version java version "1.6.0_14" Java(TM) SE Runtime Environment (build 1.6.0_14-b08) Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
JSP»·¾³´î½¨µÚ¶þ²½¡¢°²×°tomcat
1£©¡¢´Ó¹ÙÍøÏÂÔØ°²×°³ÌÐòhttp://tomcat.apache.org/download-60.cgi£¬Ñ¡Ôñ.tar.gz°²×°°üÏÂÔØ¡£
2£©¡¢°²×°tomcat
[root@linuxas ~]#cd /usr/local/src [root@linuxas src]# tar -zxvf apache-
Ïà¹ØÎĵµ£º
¾³£¿´µ½Ðí¶àÈËÎÊÈçºÎÅäÖÃJDKºÍJSP£¬ÏÖÔÚÎÒ°Ñ·½·¨×ܽáÏ£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
µÚÒ»²½£ºÏÂÔØjdkºÍtomcat
µÚ¶þ²½£º°²×°ºÍÅäÖÃÄãµÄjdkºÍtomcat£ºÖ´ÐÐjdkºÍtomcatµÄ°²×°³ÌÐò£¬È»ºóÉèÖð´ÕÕ·¾¶½øÐа²×°¼´¿É¡£
1.°²×°j2sdkÒÔºó£¬ÐèÒªÅäÖÃһϻ·¾³±äÁ¿£¬ÔÚÎҵĵçÄÔ->ÊôÐÔ->¸ß¼¶->»·¾³±äÁ¿->ϵͳ±äÁ¿ÖÐÌí¼ÓÒÔÏ»· ......
package com.demo.filter;
import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import java.io.IOException;
public class SetCharacterEn ......
Ò»Ö±¶ÔServletµÄ¼¸ÖÖÒ³ÃæÌøת·½Ê½£¬Àí½âµÄºýÀïºýÍ¿µÄ£¬½ñÌìÔÚÍøÉÏËÑÁËÒ»°Ñ£¬ÕÒµ½Ò»±é±È½ÏºÃµÄ£¬¼ÇÏÂÀ´£¬ÒÔºó¿´¿´¡£
Ìøת·ÖÁ½²¿·Ö£¬Ò»ÊÇ·¢ÉúÔÚservlet£¬Ò»ÊÇÔÚJSP£¬ÆäʵJSPÒ²¾ÍÊÇservlet£¬²»¹ý»¹ÊÇÓеã²îÒìµÎ¡£
Servlet£º
µ±È»£¬ÔÚservletÖУ¬Ò»°ãÌøת¶¼·¢ÉúÔÚdoGet, doPostµÈ·½·¨ÀïÃæ¡£
1) redirect · ......
WEB½øÐÐÉÏ´«ÖÐÎÄÎļþÃûµÄÎļþʱûÎÊÌ⣬µ«ÏÂÔصÄʱºò³öÏÖÎÊÌ⣬¾¹ýÒ»·¬²éÕÒÖ®ºóÔÀ´ÊÇTOMCATĬÈϲ»Ö§³ÖÖÐÎÄ·¾¶ºÍÖÐÎÄÎļþ£¬Èç¹ûÖ±½Ó´ÓApacheÕ¾µãÖÐÏÂÔØTomcat£¬ÎÞÂÛÊÇ°²×°°æµÄexeÎļþ£¬»¹ÊÇ
½âѹËõµÄZIPÎļþ£¬ÄÚÖõĶÔÓÚgetÐÒéÖеÄURL±àÂ붼ÊÇISO-8859-1,Õâ¸ö×Ö·û¼¯²»ÄÜÖ±½ÓÖ§³ÖÖÐÎĵÈË«×Ö½ÚµÄÐÅÏ¢£¬¶øÖÐÎÄÎļþµÄÏÂÔØ ......