ÒýÓà JDK 6u12+Tomcat6.0+JSP¾µäÅäÖÃ(Íêȫ׼ȷÎÞÎó£©
µÚÒ»²½£ºJDKÓëTomcatµÈµÄÏÂÔØÓëÅäÖÃ
×îеÄJDKΪ6.0£¨jdk-6u12-windows-i586-p.exe£©£¬tomcatΪ6.0(apache-tomcat-6.0.18.exe)
¿ª·¢»·¾³£º
JDK: jdk-6u12-windows-i586-p.exe
ÏÂÔصØÖ·:http://java.sun.com/javase/downloads/index.jsp
Tomcat:apache-tomcat-6.0.18.exe
ÏÂÔصØÖ·:http://tomcat.apache.org/download-60.cgi
¸½¼Ó£ºEclipse
Eclipse:eclipse-SDK-3.3-win32.zip
ÏÂÔصØÖ·:www.eclipse.org/downloads/ Ñ¡Ôñeclipse Classic°æ±¾
MyEclipse:MyEclipse_6.0.1GA_E3.3.1_Installer.exe¡¡
ÏÂÔصØÖ·:www.myeclipseide.com/
MyEclipse×¢²á»úÏÂÔØ:http://cnjoyfun.googlepages.com/MyEclipse6.0M1keygen.zip
°²×°ºÍÅäÖÃÄãµÄjdkºÍtomcat£ºÖ´ÐÐjdkºÍtomcatµÄ°²×°³ÌÐò£¬È»ºóÉèÖð´ÕÕ·¾¶½øÐа²×°¼´¿É¡£
1.°²×°jdkÒÔºó£¬ÐèÒªÅäÖÃһϻ·¾³±äÁ¿£¬ÔÚÎҵĵçÄÔ->ÊôÐÔ->¸ß¼¶->»·¾³±äÁ¿->ϵͳ±äÁ¿ÖÐÌí¼ÓÒÔÏ»·¾³±äÁ¿(¼Ù¶¨ÄãµÄjdk°²×°ÔÚC:\Program Files\Java\jdk1.6.0_10£©£º
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10
classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
path=%JAVA_HOME%\bin
£¨×¢Ò⣺ClasspathÖÐÒ»¶¨²»ÄÜÉÙ·ûºÅ“ .; ”£¬ÒòΪËü´ú±íµ±Ç°Â·¾¶£©
£¨×¢Ò⣺%JAVA_HOME%¾Í´ú±íÁË·¾¶¡£¼´ JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10£©
£¨×¢Ò⣺PathµÄ·¾¶µÄ×·¼Ó£¡×·¼Ó·¾¶Ê±Ò»¶¨Òª×¢Ò⻷ϵͳ¾³±äÁ¿ÖС¾ÊÇ·ñÒÑÓдËÏîÄ¿¡¿£¬²»ÄÜäĿµÄÒ»¸Å¸´ÖÆÕ³Ìù£¬¶øÓ¦¸Ã°´ÕÕÓï·¨¹æÔò×·¼Ó·¾¶£¬×·¼ÓPathʱ£¬Èç¹ûÒѾ´æÔÚÆäËûµÄÄÚÈÝ£¬ÔòÓÃÓ¢ÎĵķֺŸô¿ª£©
(×¢Ò⣺ÔÚ°²×°JDK¹ý³ÌÖУ¬»áÁíÍⵯ³ö´°¿Ú³öÏÖÑ¡Ôñ°²×°JRE·¾¶£¬´ËʱÎñ±ØÒª°²×°£¬·ñÔòÔÚ°²×°Tomcat¾Í»áʧ°Ü¡£JDK¾ÍÊÇJava Development Kit£¬ÊÇjava¿ª·¢µÄºËÐÄ£¬¿ª·¢Java³ÌÐòµÄʱºòÐèÒªJDK£¬¶øÔËÐÐJava³ÌÐòµÄʱºò¾ÍÐèÒªJRE¡£JDKÀïÃæÒѾ°üº¬ÁËJRE£¬Òò´Ë¶ÔJAVA_HOMEÉèÖÃΪJDKµÄ·¾¶Ê±Ò²¿ÉÒÔÕý³£ÔËÐÐJava³ÌÐò¡£JREÊÇJava Runtime EnviromentÊÇÖ¸JavaµÄÔËÐл·¾³£¬JRE£¨Java Runtime Environment£¬JavaÔËÐл·¾³£©£¬ÔËÐÐJAVA³ÌÐòËù±ØÐëµÄ»·¾³µÄ¼¯ºÏ£¬°üº¬JVM±ê׼ʵÏÖ¼°JavaºËÐÄÀà¿â¡£
Copyright·Jass·Luson
½Ó×Å¿ÉÒÔдһ¸ö¼òµ¥µÄjava³ÌÐòÀ´²âÊÔJDKÊÇ·ñÒÑ°²×°³É¹¦£º
public class Test{
public static void main(String args[]){
System.out.println("This is a test program.");
}
}
½«ÉÏÃæµÄ
Ïà¹ØÎĵµ£º
1.½ûÖ¹¿Í»§¶Ë»º´æÒªÔÚ<head>ÖмÓÈëÀàËÆÈçÏÂÄÚÈÝ£º
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
2.ÔÚ·þÎñÆ÷µÄ¶¯Ì¬ÍøÒ³ÖнûÖ¹»º´æ£¬Òª¼ÓÈëÀàË ......
ÑéÖ¤ÂëµÄÉú³É˼ÏëÊÇÔÚ·þÎñÆ÷¶ÎÔ¤ÏÈÉú³ÉºÃÑéÖ¤Â룬ǰ̨ÏÔʾ£¬È»ºóÔÙµ½ºǫ́ȥƥÅ䣡
code.jsp:
<%@ page language="java" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*"
contentType="image/jpeg" pageEncoding="UTF-8"%>
<% //ÉèÖÃÒ³Ãæ²»» ......
goodsbean.java
package sale;
public class goodsbean{
String Product;
double Price;
public goodsbean (){
this.Product = "box";
this.Price = 5.0;
}
public void setProduct (String ......
ÎÒÃÇÔÚдһ¸öjspÒ³Ã棬ҪʹÓÃstruts2±êÇ©£¬ÎÒÃÇÒªÊ×ÏÈÒªÔÚjspÒ³ÃæÍ·²¿·Å£º<%@ taglib prefix="s" uri="/struts-tags" %>£¬µ±È»Òª·Åstruts2µÄjar°üÁË¡£ÎÒÃÇ¿ÉÒÔË¢ÐÂһϴËÒ³Ã棬±ÈÈç°ÑÕâ¸öÒ³Ãæ±£´æºóÔÙ´ò¿ª£¬Ä¿µÄÊÇÔÚдstruts2±êǩʱ£¬ÓÐstruts2±êÇ©×Ô¶¯Ìáʾ¹¦ÄÜ¡£
......
¸Õ¿ªÊ¼Ñ§jsp£¬×öµÄÒ»µãÌý¿Î±Ê¼Ç¡£
1.jspÈý´óÖ¸Áî
<%@ page ~~~~~~~~ %>
<%@ include file=""%>
<%@ taglib url="" prfix=""%>
2.if(username.equals(""))
out.println("ÐÕÃû²»ÄÜΪ¿Õ£¬Çë<a href=javascript:history.back()>·µ»Ø")£»
&&·ÀÖ¹Ö±½ÓÔÚä¯À ......