Postingan

Menampilkan postingan dengan label jsp-servlet

Top 22 Spring Interview Questions Answers for Java JEE Developers

Gambar
Spring framework interview questions are on the rise on Java EE and core Java interviews Spring, which is obvious given Spring is the best framework available for Java application development and now Spring IOC container and Spring MVC framework are used as a de-facto framework for all new Java development. Because of its popularity,  interview questions from spring framework are top on any list of Core Java Interview questions. I thought to put together some spring interview questions and answers which have appeared on many Java and J2EE interviews and useful for practicing before appearing on any Java Job interview. I first wrote this article a long back and even its content is still relevant I thought to update it, especially after finishing my list of Spring Boot Interview Questions recently. This list of Spring interview questions and answers contains questions from Spring fundamentals e.g. Spring IOC and Dependency Injection, Spring MVC Framework , Spring Security, Spri...

Top 3 Servlet and JSP Books for Java Developers - Best of Lot

Gambar
I often receive a request from my readers and fellow Java developers about book recommendations to learn Servlet and JSP, two of the key web technology for server-side web development in Java. 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 to 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 the last 7 to 8 years, but considering others, it is still an excellent book to learn Servlet and JSP. The main advantage of this book is the Head First style itself, which is excellent for beginners. With lots of repetition, bullet points, fireside chats, Head First book, make sure you understand things and not just read them. Since ma...

Difference between SendRedirect() and Forward() in JSP Servlet

Gambar
Difference between SendRedirect and forward is one of the classical interview questions asked during a java web developer interview. This is not just applicable for servlet but also for JSP in which we can use forward action or call sendRedirect() method from scriptlet. Before examining the difference on forward and SendRedirect let’s see what send Redirect method and forward method does. SendRedirect (): This method is declared in HttpServletResponse Interface . Signature : void sendRedirect(String url) This method is used to redirect the client requests to some other location for further processing , the new location is available on different server or different contexts.our web container handles this and transfer the request using a browser, and this request is visible in browser as a new request . Sometimes this is also called as client side redirect. Forward(): This method is declared in RequestDispatcherInterface. Signature : forward(ServletRequest request, ServletResponse ...

10 examples of displaytag in JSP, Struts and Spring

Gambar
Display tag is one of the best free open source libraries for showing data in tabular format in a J2EE application using jsp, struts or spring. it is shipped as tag library so you can just include this  in your jsp and add corresponding jar and there dependency in class-path and you are ready to use it. Display tag is my favorite solution for displaying any tabular data because of its inherent capability on paging and sorting. It provides great support for pagination on its own but it also allows you to implement your own pagination solution. On Sorting front you can sort your data based on any column, implement default sorting etc. There is so much resource available on using display tag including examples, demos, and guides. In this article, we will see some important points to note while using display tag in jsp. Though this library is very stable and rich in functionality still there are some subtle things which matter and if you don't know you could potentially waste hours to...

JSTL forTokens Tag Example - Split String in JSP

Gambar
JSTL forTokens tag is another tag in core JSTL library to support Iteration or looping. It effectively compliments, more useful <c:forEach> tag, by allowing you to iterate over comma-separated or any delimited String. You can use this tag to split string in JSP and can operate on them individually. forTokens tag has similar attributes like forEach JSTL tag except one more attribute called delims, which specifies delimiter. For example to iterate over colon-separated String "abc:cde:fgh:ijk", delims=":". By the way, forTokens tag also accept multiple delimiters, which means, you can split a big string into token-based upon multiple delimiter e.g. colon(:) and pipe (|), This will be more clear, when we will see examples of JSTL forTokens tag in JSP. Rest of attribute e.g. items, var, varStatus, begin, end and step are same, as they are in case of <c:forEach> tag. For quick review, items specify String which needs to be split-ed in token and var hold curren...

Top 10 JSP Interview Questions Answers for Java Programmer

Gambar
These JSP interview questions and answers are asked in the various J2EE interview and focus on the view part of the MVC framework. JSP or Java Server Pages is a Java technology used to render a dynamic view. Whenever you go for any Java web developer interview there are always some interview questions on JSP. This article is a collection of some JSP interview questions which has asked in the various interview to my friends and colleagues. You can easily find answers to these JSP interview questions by google but I have included my version for quick reference. I would love to hear back from you and please share some JSP interview questions asked to you guys on the interview; I can include those in the main post for everybody’s benefit. This article is in continuation of my interview series of Spring interview Questions, Servlet Interview Questions, Java Interview Questions Answers and Singleton pattern interview questions JSP Interview Questions and Answers Here is collection of 10 m...

JSTL foreach tag example in JSP - looping ArrayList

Gambar
JSTL  foreach loop in JSP JSTL  foreach tag is pretty useful while writing Java free JSP code.  JSTL foreach tag allows you to iterate or loop Array List, HashSet or any other collection without using Java code. After introduction of JSTL and expression language(EL) it is possible to write dynamic JSP code without using scriptlet which clutters jsp pages. JSTL foreach tag is a replacement of for loop and behaves similarly like foreach loop of Java 5 but still has some elements and attribute which makes it hard for first-timers to grasp it. JSTL foreach loop can iterate over arrays, collections like List, Set and print values just like for loop. In this JSP tutorial we will see couple of example of foreach loop which makes it easy for new guys to understand and use foreach loop in JSP. By the way this is our second JSP tutorial on JSTL core library, in last tutorial we have seen How to use core <c:set> tag in JSP page. How to use forEach tag in JSP page forEach...