JSP

JSP (Java Server Page) ialah teknologi untuk mengontrol isi atau tampilan halaman Web melalui penggunaan servlet, program kecil yang dijalankan di server Web. Sun Microsystem, pembuat Java, mengacu kepada teknologi JSP sebagai Servlet API (Application Program Interface). Halaman HTML yang berisi link ke servlet Java memiliki akhiran .jsp

Pengertian JSP

Java Server Pages (JSP) merupakan sebuah tenologi servlet-based yang digunakan pada web tier untuk menghadirkan dynamic dan static content. JSP merupakan text-based dan kebanyakan berisi template text HTML yang digabungkan dengan spesifik tags dynamic content.

Alasan Menggunakan JSP
• Sejak JSPs merupakan dokumen text seperti HTML, para pengembang menghindari format dan manipulasi yang memungkinkan String yang sangat panjang untuk menghasilkan output. Content HTML sekarang tidak ditempelkan dengan berbagai macam kode dari Java. Hal ini membuatnya lebih mudah untuk dipelihara.
• JSPs lebih dikenal oleh semua orang dengan pengetahuan dari HTML, hanya dengan mempelajari markup dynamic. Hal ini membuatnya mungkin untuk para desainer site untuk membuat template HTML dari sebuah site, dengan para pengembang memprosesnya suatu saat nanti untuk memasukkan tags yang menghasilkan dynamic content. Hal ini juga memudahkan dalam pengembangan web page.
• JSPs memiliki built-in yang mendukung untuk penggunaan komponen software yang dapat digunakan kembali(JavaBeans). Hal ini tidak hanya membiarkan para pengembang menghindari kemungkinan menemukan kembali inti/kemudi dari tiap aplikasi, mempunyai software pendukung untuk memisahkan komponen software untuk menghandle logic promotes separation dari presentasi dan business logic.
• JSPs, merupakan bagian solusi dari Java untuk pengembang aplikasi web, merupakan multi-platform yang tak terpisahkan dan dapat dijalankan pada berbagai container servlet yang compatible, dengan mengabaikan vendor atau sistem operasinya.
• Dalam kaitannya dengan cara kerja JSPs, mereka tidak membutuhkan kompilasi dari para pengembang. Kompilasi ini telah ada untuk kita pada kontainer servlet. Modifikasi JSPs dideteksi secara otomatis. Hal ini secara relatif membuatnya mudah untuk dibangun.

Contoh JSP

Gambar diatas adalah file JSP yang simple yang melakukan penyambutan untuk site user sebagai penginformasian tanggal dan waktu saat ini untuk user.
Dari contoh diatas, kita dapat melihat bahwa file JSP merupakan sebagian besar dari HTML. Hanya pada bagian ini yang beda :
<%= new java.util.Date()%>
Hal ini merupakan bagian dari kode Java untuk menampilkan hari dan tanggal pada saat itu juga. Hal ini mempermudah unutk membuat objek baru untuk membuat objek Date dan menampilkannya sebagai String.

Alur JSP
Container servlet mengatur JSPs pada suatu cara untuk mengatur servlet itu sendiri melalui penggunaan suatu alur JSP maka dapat dijalankan dengan baik.
JSPs memiliki tiga fase alur : inisialisasi, servis, dan destruksi. Fase-fase ini sama dengan method servlet yang diambil dari container yang berbeda : jspInit() untuk inisialisasi fase, _jspService() untuk servis fase, dan jspDestroy() untuk mendestruksi fase.

Dari contoh JSP yang telah diberikan, terlihat membingungkan untuk membahas method jspInit atau _jspService(). Contoh dari JSP hanya simple text page yang kebanyakan berasal dari content HTML : dia tidak memiliki method yang lain. Jawaban dari ha tersebut adalah : JSPs di-compile kedalam class servlet yang sama oleh server. Hal ini menyebabkan class servlet yang menangani permintaan untuk page JSP. Translasi ini dimasukkan kedalam servlet dan kompilasi subsequent telah selesai digunakan oleh server : para pengembang tidak perlu ragu-ragu tentang bagaimana prosedure ini diselesaikan.

source

Komentar
  1. grosir baju bayi berkata:

    Wow, fantastic blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is excellent, let alone the content!. Thanks For Your article about JSP Secarik Kertasâ„¢ .

  2. hair growth hair berkata:

    I just want to say I am newbie to weblog and definitely enjoyed you’re web-site. Most likely I’m going to bookmark your blog post . You absolutely have amazing well written articles. Appreciate it for sharing with us your web site.

  3. I simply want to say I am just all new to blogs and honestly enjoyed this blog site. Almost certainly I’m likely to bookmark your website . You actually come with fantastic article content. Regards for revealing your webpage.

  4. I just lately came across your blog and have been reading along. I thought I would leave my initial comment. I do not know what to say except that I’ve liked reading. Great weblog. I will keep viewing this weblog really usually.

  5. Cool post . Thanks for, visiting this blog page dude. Ill email you some time! I did not realise that!

  6. Jesus Christ theres a great deal of spammy feedback on this site. Have you ever believed about trying to remove them or installing a extension?

  7. custom t shirts berkata:

    Im getting a javascript error, is anyone else?

  8. This is the proper JSP Secarik Kertasâ„¢ blog for anyone who wants to essay out out around this message. You mention so often its near wearying to contend with you (not that I real would want…HaHa). You definitely put a new revolve on a substance thats been written active for period. Overnice sundries, only enthusiastic!

  9. Lilli Unger berkata:

    Excellent items from you, man. I’ve keep in mind your stuff previous to and you’re simply extremely great. I actually like what you’ve obtained right here, really like what you’re stating and the way in which by which you are saying it. You make it enjoyable and you still care for to keep it sensible. I cant wait to learn much more from you. This is actually a great site.

  10. go here berkata:

    When are you going to post again? You really inform a lot of people!

  11. This website is very cool. How was it made !

  12. view site berkata:

    When are you going to post again? You really entertain me!

  13. In the the top to the the lower, this website is actually amazing! Routing over here is indeed simple, each and every submit get excellent marking, so we could learn about in which some tips i need to have! Amazing, just fantastic

  14. view site berkata:

    Im getting a small issue. I cant get my reader to pickup your rss feed, Im using aol reader by the way.

  15. I quite positive its single associated with few web site with the considerably helpful information about it. A really pleasant look, basic menus, i privately truly appreciated along with taken into account true information. Just about all I need area.

  16. I dugg some of you post as I cerebrated they were very useful very useful

  17. I was basically curious about if you ever considered replacing the page layout of your blog? Its well written; I love what you have got to state. But maybe you can include a little more in the way of content so people can connect with it better. You have got a great deal of text for only having one or two graphics. Maybe you can space it out better?

  18. Gale berkata:

    Very good info. Lucky me I came across your blog by accident
    (stumbleupon). I have saved as a favorite for later!

  19. I’m gone to tell my little brother, that he should also go to see this blog on regular basis to take updated from latest information.

  20. låne berkata:

    Strange , your site turns up with a dark hue to it, what color is the primary color on your web site?

  21. evening dresses berkata:

    Greetings! Very helpful advice within this article!
    It is the little changes that produce the greatest changes.
    Thanks a lot for sharing!

  22. Inga Fiorenzi berkata:

    I’m just writing to let you understand of the brilliant discovery my cousin’s daughter undergone going through yuor web blog. She discovered numerous things, with the inclusion of what it is like to have an awesome coaching nature to have certain people without hassle learn about chosen specialized subject areas. You really surpassed readers’ desires. I appreciate you for distributing these useful, trusted, edifying and even fun tips about this topic to Julie.

  23. window cleaner berkata:

    Mate! This blog is cool. How do you make it look like this !

  24. obviously like your web site however you filbutrw have to test the spelling on quite a few of your posts. Many of them are rife with spelling problems and I in finding it very troublesome to inform the reality however I’ll certainly come again again.

  25. bathing suits berkata:

    What’s up, this weekend is nice for me, since this moment i am reading this wonderful informative article here at my residence.

  26. Rosie Mccadams berkata:

    I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Exceptional work!

Beri Komentar Disini