Tampilkan postingan dengan label jsp-servlet. Tampilkan semua postingan
Tampilkan postingan dengan label jsp-servlet. Tampilkan semua postingan

Jumat, 25 Maret 2016

This time its servlet interview questions, I was thinking what to pick for my interview series and then I thought about J2EE and Servlet is my favorite on that space. Servlet is an important part of any J2EE development and serves as Controller on many web MVC frameworks and that�s why it�s quite popular on J2EE interviews. These Servlet questions are based on my experience as well as collected by friends and colleague and they are not only good for interview practice but also shows a new direction of learning for anyone who is not very familiar with servlet technology.

Servlet interview question and answerAs said earlier this interview question article is part of my earlier series java interview questions , UNIX command interview questions and Java threading interview questions.

You can find answers to all these questions on google but I have also listed my answers for quick reference.
Read more �

Rabu, 13 Maret 2013

I had work previously on Struts 1 but never touched Struts 2, specially since Spring MVC was there to take the leading role. Recently one of my friend ask me to help with Struts2, which leads me to look on Struts2 framework from start. First thing I wanted to find out differences between Struts 1 and Struts 2 framework, because in my experience, if you have worked in previous version looking differences between two versions of Struts can quickly help to find, what changes and What are the new features, concepts and improvement is offered by Struts 2. Also difference between Struts 1 and Struts 2 is a good candidate to include in my list of Struts interview questionfor quick revision. To my surprise, Struts 2 seems to be completely different than Struts 1 framework, because some of the most familiar stuff like ActionForm, struts-config.xml, and Action classes are changed in Struts 2 framework. Struts 2 has also done good job on removing direct dependency of Action classes on Servlet API e.g. HttpServletRequest and HttpServletResponse, which makes testing easy by using Dependency Injection concept. In this article, we will some important differences between Struts 1 and Struts 2 framework.
Read more �

Selasa, 12 Februari 2013

<c:if> or if tag of JSTL core tag library in JSP is one of the most versatile and useful tag. JSTL if tag allows you
to test for a condition, like checking for a particular parameter in requestScope, sessionScope or pageScope. You can also check any parameter in request parameters and headers or can check for a variable in JSP page using <c:if> tag. JSTL if tag helps a lot to reduce amount of Java code from JSP page and if used, along with expression language JSTL core tag library, can remove almost all Java code from JSP files. Earlier we have seen examples of JSTL foreach tag and JSTL core set tag and this JSP JSTL tutorial is based on if tag of JSTL core tag library. We will, see how to use <core:if> tag inside JSP files and different example of <core:if> tag to get ourselves familiar with functionality and power offered by JSTL <c:if> tag. After seeing these examples of <core:if> tag along with expression language, You will be amazed to see, how clean your JSP looks like.
Read more �

Selasa, 05 Februari 2013

Avoiding multiple submission of HTML form or POST data is common requirement in Java web application. Thankfully, You can prevent multiple submission by disabling submit button in HTML and JavaScript itself, rather than handling it on server side. This is very common requirement while developing web application using Servlet and JSP or any other web technology. At same time there are lot of information and noise available in web and its very hard to find simple approach to disable submit button. When I search for simple way to disable submit button in HTML and JavaScript, I was overwhelmed by responses on forums and various online community. Those are good for intermediate HTML and JavaScript developer but a beginner might just get overwhelmed by amount of information presented and rather confused to use which approach will work, how exactly should I disable submit button to prevent multiple form submissions etc. That drives me to write this post and summarize the simplest possible approach to disable submit button using HTML and JavaScript. I see there could be issues related to browser compatibility which we can talk once we know the simplest approach and my intention is to add those issues and there remedy as and when I know about it to keep this article update, relevant and simple. By the way How to avoid multiple submission of HTML form is also a popular JSP Interview questionand worth preparing.
Read more �

Senin, 21 Januari 2013

Display tag provides export options to export page into PDF, CSV, Excel and XML in Java web application written using JSP, Servlet, Struts or Spring MVC framework. Display tag is a tag library and you just need to use it in your JSP page to display tabular data or generate HTML tables dynamically. Earlier we have seen 10 display tag tips for getting most out of display tag and in this JSP Servlet tutorial we will see one display tag export issue, which prevent display tag export functionality to work properly. Display tag experience is considered good in various JSP Interview and some questions related to sorting, paging, both internal paging and external paging and exporting on display tag also appear as various J2EE and Servlet Interview questions. In my opinion, after JSTL core tag library, display tag is most popular tag library and every Servlet and JSP developer should familiar with display tag.
Read more �

Minggu, 12 Agustus 2012

What is JSESSIONID in JSP-Servlet
JSESSIONID is a cookie generated by Servlet containers like Tomcat or Jetty and used for session management in J2EE web application for HTTP protocol. Since HTTP is a stateless protocol there is no way for Web Server to relate two separate requests coming from the same client and Session management is the process to track user session using different session management techniques like Cookies and URL Rewriting. If a Web server is using a cookie for session management it creates and sends JSESSIONID cookie to the client and then the client sends it back to the server in subsequent HTTP requests. JSESSIONID and session management is a not only a popular Servlet interview question but also appear in various JSP interviews. Along with What is JSESSIONID interviewer are also interested in when and how JSESSIONID is created in Servlet and JSP which we will see in next section.
Read more �