Jsp Servlet
Iam new to the servlet .the following code are listed below
File Name is : Sampleservletexample.java
import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Sampleservletexample extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet
{
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<title>Example</title>" +"<body bgcolor=FFFFFF>");
out.println("<h2>The Value is</h2>");
String DATA = request.getParameter("messages");
out.println(DATA);
out.close();
}
}
the following html i have written
<html>
<head>
<title>Sample</title>
<body>
<form method="POST" action="\Sampling">
Messaging<select name="messages">
<option value="rummymanager">RummyManager</option>
<option value="rummyrefree">RummyRefree</option>
<option value="rummymovemanager">RummyMoveManager</option>
</select>
<input type="Submit" value="Submit">
</form>
</body>
</html>
the following things i have written in web.xml
<servlet>
<servlet-name>Sampling</servlet-name>
<servlet-class>Sampleservletexample</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Sampling</servlet-name>
<url-pattern>/Sampling</url-pattern>
</servlet-mapping>
Iam not able to retrieve the value which is given in the html

