-
1. Re: HTTP POST
vinays Dec 15, 2002 2:27 PM (in response to simperitog)how are u accessing yr servlet? one of teh reasons cd be like teh doPost() method is missing.
cheers
Vinay Salehithal -
2. Re: HTTP POST
simperitog Dec 16, 2002 3:06 AM (in response to simperitog)doPost() is there. what else needs to be set ? there seems to be a whole bunch of *.xml configuration files.
-
3. Re: HTTP POST
vinays Dec 16, 2002 12:47 PM (in response to simperitog)it wd help if u cd post yr servlet here, and also the htm/whatever from which its invoked.
cheers
Vinay Salehithal -
4. Re: HTTP POST
simperitog Dec 16, 2002 1:44 PM (in response to simperitog)Here are the code snippets. The client is a simple Applet and the Server is a simple Servlet.
The Applet
==========
smsurlcon = (HttpURLConnection) nurl.openConnection();
smsurlcon.setDoOutput(true);
smsurlcon.setDoInput(true);
smsurlcon.setUseCaches(false);
smsurlcon.setRequestProperty("Content type","text/bsv");
OutputStream os = smsurlcon.getOutputStream();
String sout = "param="+cmd1+","+cmd2+","+cmd3;
os.write(sout.getBytes());
os.flush();
is = smsurlcon.getInputStream();
//is = nurl.openStream();
int i = 0;
while (!(is.available()>0)&& i < 10)
{
i++;
Thread.currentThread().sleep(100);
System.out.println(" waiting " + i);
}
The Servlet
============
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
System.out.println(" Entering doPost()");
System.out.println("Content type: "+request.getContentType());
doX(request, response);
} -
5. Re: HTTP POST
vinays Dec 16, 2002 3:20 PM (in response to simperitog)try using smsurlcon.setRequestMethod("POST");
-
6. Re: HTTP POST
simperitog Dec 16, 2002 6:13 PM (in response to simperitog)tried using setting the method to "POST", which by the way does not have anything to do with the server/Tomcat .
The client(Applet) uses "POST" as soon as the OutputSream is opened. -
7. Re: HTTP POST - solved (caused by broken JBoss hot deploy)
simperitog Dec 17, 2002 2:40 PM (in response to simperitog)I think , the problem is solved. There were two copies of the same Servlet classes in the JBoss jar file and the Tomcat war file. I do not always update the JBoss jar file as that requires a restart (hot deploy is broken in JBoss EJB). The Tomcat war file can be hot deployed. Unfortunately, Tomcat picks up the Servlet class from the EJB jar file rather than the Tomcat war file - I guess that is the price paid for using the same JVM. Although I think it can be corrected.
-
8. Re: HTTP POST - solved (caused by broken JBoss hot deploy)
vinays Dec 17, 2002 5:24 PM (in response to simperitog)hmmm...interesting.
Yes, I have read abt issues caused by Unified Class laoder in JBoss 3 and above. Seems the solutions lies in scoping using ear files and jboss-app.xml. Haven't tried it though.
cheers