import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class pro12 extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException { res.setContentType("text/html"); PrintWriter out=res.getWriter(); out.printf("<html><head><title>2ND PROGRAM-pankaj</title></head><body bgcolor='limegreen'>"); out.println("<table border=1 align='center' width=60%><caption>PARAMETER NAME AND THEIR VALUES<tr><th>FIELD<th>VALUE"); Enumeration name=req.getParameterNames(); while(name.hasMoreElements()) { String hname = (String)name.nextElement(); String hvalue= req.getParameter(hname); out.println("<tr><td>"+hname); out.println("<td>"+hvalue); } out.printf("</table>"); out.printf("</body>"); } }
Structure Query Language, C programming, Java, Servlet, Jsp, Unix
Tuesday, 14 February 2012
Write a Servlet to display parameters available on request.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment