Servlet Interview Questions and Answers, job interview questions, interview questions, Servlet interview faqs!
Sycorax - complete tutorials
Programming Tutorials
" Java provides the industry - software companies and customer alike , an opportunity to create a true open computing environment where software is portable,
and customers benefit from increase competition. "
Java and the Future
December 1, 2008-LEJB 3.1: EJB New and Improved!
The EJB 3.0 specification was a huge improvement from what you were used to in the early versions of EJB. Available as an early draft, EJB 3.1 has many more features and is even easier to use.
December 1, 2008-Should Java Assert that Network I/O Can't Occur on the UI Thread?
Doing network I/O on the user interface (UI) thread is bad. Most developers know that and can tell you why; unfortunately, it's still done.
Register now to recieve special alert and latest technology news!
Java Servlet Interview Questions
In a servlet how to reads all data from a form?
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class FormReaderServlet extends HttpServlet {
ServletConfig sc;
public void init(ServletConfig sc)throws ServletException {
super.init(sc);
}
public void service(ServletRequest request , ServletResponse response)
throws ServletException , IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Enumeration enum = request.getParameterNames();
/* Developer can use request.getParameter() if there is only one parameter in the Form or else he can use
getParameterNames() only
*/
while(enum.hasMoreElements()) {
String str = (String)enum.nextElement();
String key = request.getParameter(str);
out.println(str + "\t" + key);
}
}
public void destroy(){}
}

