What response do you get when you use telnet to access that url?

-----Original Message-----
From: Morgan Rachell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 17, 2004 10:50 AM
To: [EMAIL PROTECTED]
Subject: Using commons HttpClient to call an Action, but it doesn't work


I'm using the following code in an initialization routine to call an Action.

This occurs the first time a user hits the application. This was all working
on 
WebSphere 4.0.4, but we upgraded to WS 5.1.0.5 and now it doesn't work. No 
error, no logs, no exception. Just like it doesn't get called. Of course,
the 
same app (EAR file) works fine on a development server.

Any reason why this wouldn't work in the execute() method of another action?

// Create Action URL
String requestUrl = request.getRequestURL().toString();
String webAppUrl = requestUrl.substring(0, requestUrl.lastIndexOf("/") );
String loadStateFormsUrl = webAppUrl + "/initAction.do";

HttpClient client = new HttpClient();     
HttpMethod method = new GetMethod(url);
try {
    int statusCode = client.executeMethod(method);
} catch (HttpRecoverableException e) {
    result = "Exception occurred: " + e.getMessage();
} catch (IOException e) {
    result = "Failed to get a URL's response.";
}

// Read the response body.
byte[] responseBody = method.getResponseBody();
result = new String(responseBody);

// Release the connection.
method.releaseConnection();



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to