I invoke my doPost Servlet using a wget --post-data. This works fine and the response for OK and Failure are working. However, I cannot correctly code the addHeader statement. Will the header text be generated as output automatically?
Any ideas?
.........
String h_mainname="StatusAdmin";
String h_name="StatusUpdate";
........
.......
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
// the next line is incorrect
public void addHeader(java.lang.String h_name, java.lang.String h_val);
String lname = request.getParameter("lname");
String task = request.getParameter("task");
response .setStatus(response.SC_OK, "All is Well");
}
Any ideas?
.........
String h_mainname="StatusAdmin";
String h_name="StatusUpdate";
........
.......
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
// the next line is incorrect
public void addHeader(java.lang.String h_name, java.lang.String h_val);
String lname = request.getParameter("lname");
String task = request.getParameter("task");
response .setStatus(response.SC_OK, "All is Well");
}