TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Java Servlet Question



Greet the sun all,

I am trying to simulate from a test class, a POST call to a servlet
through the following chunk of code:

URL t_serverURL = new URL("http://localhost:7001/test/PostServlet");
   
URLConnection t_urlConnection = t_serverURL.openConnection();
t_urlConnection.setDoOutput(true);

PrintWriter t_postOutputStream = new
PrintWriter(t_urlConnection.getOutputStream());

t_postOutputStream.println("Bong!");
t_postOutputStream.close();

The test class runs to completion without any errors.  However, I see no
entry in the access log (POST or GET) and the servlet is never
accessed.  Ideas on what I am doing wrong?

-- 
Perry Hoekstra
E-Commerce Architect
Talent Software Services
dutchman@mn.uswest.net