Welcome to Abdul Malik Ikhsan's Blog

Packaging Web Components (JSP)

Posted in Tutorial JSP by samsonasik on April 10, 2008

Pemaketan pada JSP dikenal dengan nama WAR (Web Application Archive), ini digunakan untuk mengarsipkan aplikasi yang didalamnya bisa dimasukkan segala class yang biasa kita tampung di \web-inf\classes, dan file2 jsp kita.
secara default,(menggunakan Tomcat), file war yang terpasang adalah ROOT.war, nah, misal kita coba mengarsipkan yang lain, misalnya wordpress.war, caranya kita masuk ke folder wordpress, kita buat War di situ, di sini saya ambil contoh wordpress.war dengan cara ketik jar -cvf wordpress.war * , * berarti semua file yang ada di dalamnya diikut sertakan, baik file maupun folder.

Code:
F:\Tomcat\webapps\ROOT\wordpress> jar -cvf wordpress.war *
added manifest
adding: connect.jsp(in = 403) (out= 277)(deflated 31%)
adding: handsome.jsp(in = 156) (out= 68)(deflated 56%)
adding: handsome.jsp.bak(in = 144) (out= 91)(deflated 36%)
adding: login.jsp(in = 1072) (out= 494)(deflated 53%)
adding: login.jsp.bak(in = 1058) (out= 485)(deflated 54%)
adding: logout.jsp(in = 234) (out= 162)(deflated 30%)
adding: logout.jsp.bak(in = 235) (out= 162)(deflated 31%)
adding: mvc/(in = 0) (out= 0)(stored 0%)
adding: mvc/input.html(in = 422) (out= 222)(deflated 47%)
adding: mvc/head.jsp(in = 23) (out= 24)(deflated -4%)
adding: show.jsp(in = 14) (out= 16)(deflated -14%)
adding: show.jsp.bak(in = 33) (out= 35)(deflated -6%)
adding: tes.jsp(in = 49) (out= 39)(deflated 20%)
adding: utama.jsp(in = 365) (out= 216)(deflated 40%)
adding: utama.jsp.bak(in = 365) (out= 217)(deflated 40%)

Nah, kita sekarang bisa deploy, caranya , buka http://localhost:8080
masuk ke Tomcat Manager, masukkan username dan password tomcat, akan tampil Tomcat Web Application Manager
di bawah ada WAR file to deploy
tinggal browse, cari file war yang telah kita bentuk, dan deploy, beres deh :
Kita bisa panggil sekarang http://localhost:8080/wordpress

Advertisements

3 Responses

Subscribe to comments with RSS.

  1. […] buat project yang struktur directory nya seperti di bawah ini. (Jika belum terbiasa menggunakan WAR (Web Application Archive) , Anda bisa gunakan ROOT directory  ) […]

  2. Iwan Setiawan said, on January 31, 2013 at 1:15 am

    .mas mau tanya ko saya gk bisa masuk ke tomcat manager nya ya..?

  3. samsonasik said, on January 31, 2013 at 2:33 am

    user & password nya salah kali, coba ingat2 lagi pas instalasi.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: