Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 14

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

ParameterServlet.java import java.io.*; import java.util.*; import javax.servlet.*; public class ParameterServlet extends GenericServlet { public void service(ServletRequest req,ServletResponse res)throws ServletException,IOException { PrintWriter pw=res.getWriter(); Enumeration e=req.getParameterNames(); while(e.hasMoreElements()) { String pname=(String)e.nextElement(); pw.print(pname+"="); String pvalue=req.getParameter(pname); pw.println(pvalue); } pw.close(); } } Web.xml
WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

<web-app> <servlet> <servlet-name>param</servlet-name> <servlet-class>ParameterServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>param</servlet-name> <url-pattern>/param</url-pattern> </servlet-mapping> </web-app>

Param.html <html> <head> <title> student information </title> </head> <body> <center> <form name="form1" method="post" action="http://localhost:2011/new/param"> <h3>enter student details in following fields</h3>
WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

<table> <tr> <td><b>roll number</td> <td><input type="text" name="roll number"size="25" value=" "></td> </tr> <tr> <td><b>student name</td> <td><input type="text" name="student name"size="25" value=" "></td> </tr> <tr> <td><b>student address</td> <td><textarea cols="15" rows="5" name="student address"></textarea></td> </tr> <tr> <td><b>phone number</td> <td><input type="text" name="phone number" size="25" value=" "></td> </tr> <tr> <td> <b>total marks</td>

<td><input type="text" name="total marks" size="25" value=" "></td> </tr> </table> <input type="submit" value="submit"> <input type="reset" value="reset"> </form> </center>
WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

</body> </html>

First.java import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class first extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res)throws IOException,ServletException { res.setContentType("text/html"); PrintWriter out=res.getWriter(); out.println("<html>"); out.println("<head>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Welcome to Servlet</h1>"); out.println("</body>"); out.println("</html>");

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

} } Web.xml <?xml version="1.0"?> <web-app> <servlet> <servlet-name>first</servlet-name> <servlet-class>first</servlet-class> </servlet> <servlet-mapping> <servlet-name>first</servlet-name> <url-pattern>/first</url-pattern> </servlet-mapping> </web-app>

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

Tomcat Installation 1. Click on the apache tomcat setup file, which automatically installs the tomcat web server on your computer. The following are the steps involved in the installation

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

2. Now Click on the I agree button to accept the license agreement of apache.

3. Select the type of install and click on next button.

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

4. Select the destination folder and click on next.

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

5. Now in the configuration window provide the connector port.

6. Select the JVM path and click on next button.

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

7. Installation process starts.

WEB TECHNOLOGIES LAB

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHNOLOGY, KADAPA IV CSE-A

8. After the completion of installing Apache Tomcat the following window appears, here click on finish.

WEB TECHNOLOGIES LAB

You might also like