Home » Tag Archives: Servlet

Tag Archives: Servlet

Java Servlet Tutorial – The ULTIMATE Guide (PDF Download)

java-interview-questions-answers

Java Servlets is a Java based web technology. Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems. A servlet can almost be thought of as an applet that runs on the server side–without a face. Java servlets make many Web applications possible. Java Servlets ...

Read More »

Top 100 Java Servlet Questions

java-interview-questions-answers

1) Is it the “servlets” directory or the “servlet” directory? Answer: For Java Web Server: on the file system, it’s “servlets” c:\JavaWebServer1.1\servlets\DateServlet.class in a URL path, it’s “servlet”: http://www.stinky.com/servlet/DateServlet 2) How do I support both GET and POST protocol from the same Servlet? Answer: The easy way is, just support POST, then have your doGet method call your doPost method: ...

Read More »

Servlet Exception and Error Handling Example Tutorial

java-interview-questions-answers

Sometime back I wrote a post about Exception Handling in Java but when it comes to web application, we need more than normal exception handling in java. Servlet Exception If you notice, doGet() and doPost() methods throw ServletException and IOException, let’s see what happens when we throw these exception from our application. I will write a simple servlet that will ...

Read More »

50 Servlet Interview Questions and Answers

java-interview-questions-answers

Servlets are very important topic of Java EE and all of the web applications framework such as Spring and Struts are built on top of it. This makes servlet a hot topic in Java interviews. Here I am providing a list of 50 servlet interview questions with answers to help you tackle most of the interview questions related to servlets ...

Read More »

Async Servlet Feature of Servlet 3

java-interview-questions-answers

Before we jump into understanding what Async Servlet is, let’s try to understand why do we need it. Let’s say we have a Servlet that takes a lot of time to process, something like below.                 LongRunningServlet.java package com.journaldev.servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; ...

Read More »

Servlet Upload File and Download File Example

java-interview-questions-answers

File Upload and Download and common tasks in a java web application. Since I have written a lot about java servlet recently, I thought to provide a sample example of file upload and download using servlet. Use Case Our use case is to provide a simple HTML page where client can select a local file to be uploaded to server. ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close