Postingan

Menampilkan postingan dengan label JSP and Servlet

Best Books to Learn Servlet and JSP

Unfortunately, there are not many good books to learn Servlet and JSP for Java web developers. Despite being the most popular Java Web technology, there are very few good books to learn Servlet and JSP. The one book, which everybody will suggest you is the Head First Servlet and JSP , which is indeed one of the best books but it's outdated now. It doesn't cover the latest development in Servlet API, particularly Servlet 3.0 and also not been updated for last 7 to 8 years, but considering others, it is still a good book to learn Servlet and JSP. The main advantage of this book is Head first style which is great for beginners. With lots of repetition, bullet points, fireside chats, Head First book make sure you understand things and not just read them. Since many readers ask me to suggest good books learn Servlet and JSP, I'll share a couple of title in this book, which I think is relevant and help you to learn Servlet and JSP better. Read more �

How to loop over HashMap in JSP using JSTL

Though there are a number of ways to loop over an HashMap in JSP, or any other Map implementation e.g. Hashtable, I personally prefer the JSTL foreach tag for iteration over HashMap in JSP. As a Java programmer, you will often have a strong urge to use Java code directly in JSP using scriptlet, but that's a bad coding practice and one should always avoid that. In fact, by smart use of expression language and JSTL core tag library, you can reduce a lot of Java code from your JSP page. In our last post, we have seen an example of JSTL foreach tag to loop over List , but not an HashMap, and that creates a doubt in one of my readers mind that foreach tag doesn't support Map implementation like HashMap or Hashtable as they are not Collection, but that's not true. You can use the same technique to loop over an HashMap in JSP which we have used earlier to loop over a list in JSP. Read more �