You are on page 1of 7

HNG DN CI T MI TRNG LM VIC STRUTS2

Ci t JDK
u tin, bn cn ci t bn JDK Java version cui cng. Download ti http://java.com/ hoc http://www.oracle.com/technetwork/java/javase/downloads/index.html

I.

II.

Ci t Eclipse
Trong qu trnh nghin cu k thut v Struts2, IDE chng ta ch yu s dng l Eclipse bn Helios. Link down load ti http://eclipse.org/downloads/, sau ta chn version download l Eclipse IDE for Java EE Developers

Sau khi download v ci t Eclipse thnh cng, chng ta m Eclipse s c giao din nh sau:

III.

Ci t Apache Tomcat 1. Gii thiu v download


Apache Tomcat l mt tool h tr java trong vic to server o (tng t nh IIS ca ASP), c th tch hp vo Eclipse. Trong nghin cu k thut ln ny chng ta thng nht s dng Tomcat 6.x, link download ti: http://tomcat.apache.org/download-60.cgi Chn download version Core Zip

Sau khi download v, chng ta gii nn ti a C:/

2. Kim tra v cu hnh Apache Tomcat


Cch kim tra Tomcat c chy c hay khng, bn chay file sau: ...\apache-tomcat-6.0.32\bin\startup.bat

Nu chy c th s c giao din nh sau:

V ng thi ta m browser g ng link http://localhost:8080/ s c giao din nh sau (ch : port mc nh Tomcat l 8080, v my ti i port Tomcat nn l 8282, hng dn i port nm cui ti liu ny.)

V ta chy file ...\apache-tomcat-6.0.32\bin\shutdown.bat tt Tomcat. Nu KHNG chay c Tomcat (khng c giao din nh trn), bit chnh xc l do, ta vo cmd v gi n file startup.bat Nu li thng bo nh hnh di y, th nguyn nhn do Tomcat cha c thit lp ng dn vi JDK

Cch sa: ta m file startup.bat v shutdown.bat, thm dng sau vo u mi file: set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_23 Ch : C:\Program Files\Java\jdk1.6.0_23 l ng dn JDK trong my ca ti, bn cn thay th tng ng vi my ca bn.

3. Tch hp Tomcat vo Eclipse


Sau , chng ta m Eclipse tch hp Apache tomcat nh sau:

Vo Window Preferences Server Runtime Enviroments chn Add

Tip theo, chng ta chn Apache Apache Tomcat v6.0 Next

Cui cng ta chn Tomcat installation dicrectory l ng dn th mc Apache Tomcat m chng ta gii nn trc , sau Finish.

Trong bng cc server runtime c thm Apache Tomcat chng ta va thit lp

IV.

B sung: Hng dn i port Tomcat:


V mt v l do, Tomcat khng th chy c port 8080 (c th do chng trnh khc, v d Netbeans, IIS ang s hu port ny), bn ch cn chuyn port. Bn vo file sau: \apache-tomcat-6.0.32\conf\server.xml Ti dng: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> Bn ch cn thay 8080 thnh port mun thay i:

You might also like