Trupti brane wrote:
message /WebApplication1/newhtml
description The requested resource (/WebApplication1/newhtml) is not available.
Apache Tomcat/6.0.26
Trupti brane wrote:newhtml.html
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form action="http://localhost:8080/WebApplication1/newhtml1" method="post">
<table style="height: 173px;width: 242px">
<tr>
<td>Last Name:</td>
<td><input type="text" name="Last_Name" size="15"></td>
</tr>
<tr>
<td>First Name:</td>
<td><input type="text" name="First_Name" size="15"></td>
</tr>
</table>
<input type="submit" name="submit" value="submit" >
</form>
</body>
</html>
newservlet.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class NewServlet1 extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
String Last_Name = request.getParameter("Last_Name");
String First_Name=request.getParameter("First_Name");
out.println("<html>");
out.println("<head>");
out.println("<title>Form 1</title>");
out.println("</head>");
out.println("<body>");
out.println("<table>");
out.println("<th>DETAILS</th>");
out.println("<tr>");
out.println("<td>Last Name:</td>");
out.println("<td>"+Last_Name+"</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td>First Name:</td>");
out.println("<td>"+First_Name+"</td>");
out.println("</tr>");
out.println("</table>");
out.println("<h1>Servlet NewServlet1 at " + request.getContextPath () + "</h1>");
out.println("</body>");
out.println("</html>");
} finally {
out.close();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
public String getServletInfo() {
return "Short description";
}
}
Trupti brane wrote:@Nam Ha can you tell me what is web.xml??? i do not come across such file.
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|