tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: j_security_check
Date Sun, 03 Feb 2008 16:56:16 GMT

Tough to say without seeing the source..
Can we see the code for GetMethod.java ?
Can we see the code for PostMethod.javaMartin ______________________________________________Disclaimer
and confidentiality noteEverything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and Sender does not endorse
distribution to any party other than intended recipient. Sender does not necessarily endorse
content contained within this transmission.> Date: Sat, 2 Feb 2008 19:38:29 -0800> From:
ashok_av@yahoo.com> Subject: j_security_check> To: users@tomcat.apache.org> >
Hi,> I have the following code in a scheduler class, which is trying to invoke a servlet>
> String url = "https://localhost:8444/servlet/TestServlet";> > // Get HTTP client
instance> HttpClient httpClient = new HttpClient();> // Create HTTP GET method and execute
it> > GetMethod getMethod = null;> PostMethod postMethod = null;> > int int_result
= 0;> getMethod = new GetMethod( url );> getMethod.setFollowRedirects(true);> int_result
= httpClient.executeMethod( getMethod );> String contents = getMethod.getResponseBodyAsString();>
getMethod.releaseConnection();> > postMethod = new PostMethod( "https://localhost:8444/j_security_check"
);> postMethod.addParameter( "j_username", "test" );> postMethod.addParameter( "j_password",
"test" );> int_result = httpClient.executeMethod( postMethod );> contents = postMethod.getResponseBodyAsString();>
postMethod.releaseConnection();> > postMethod = new PostMethod( url );> postMethod.addParameter(
"Password", "foo" );> int_result = httpClient.executeMethod( postMethod );> > ---------->
At this point when the test servlet is called, the parameter password is null. > getParameter
always returns null> getMethod returns GET when it should be post > It seems that the
POST is behaving like a GET. > > This code works just fine on tomcat 5.0. After upgrading
to 6.0, i am seeing this bizarre behaviour> > Any thoughts?> > > ____________________________________________________________________________________>
Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message