Welcome to Abdul Malik Ikhsan's Blog

Working with jstl

Posted in Tutorial JSP by samsonasik on December 4, 2007

Dengan menggunakan JSTL (Java Standard Tag Library), kita bisa menggunakan tag-tag(<>) library yang dimiliki oleh java, caranya, kita bisa copy kan folder lib yang ada di folder example\web-inf tomcat kita ke folder root\web-inf webapps kita, nah, contoh penggunaannya seperti berikut :

<%@ taglib uri=”http://java.sun.com/jsp/jstl/core&#8221; prefix=”c” %>
<html><body>
Welcome to our page !
<c:if test=”${empty param.username}”>
<jsp:forward page=”HandleIt.jsp”/>
</c:if>
Hello ${param.username}
</body></html>

—————
—> jika tidak input username, maka forward ke HandleIt.jsp, tanpa mengubah alamat adress bar :), selamat mencoba.

—-> Head First Servlet & JSPBryan Basham, Kathy Sierra, & Bert Bates.

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: