This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes can GET but not POST w Tomcat and IIS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "can GET but not POST w Tomcat and IIS" Watch "can GET but not POST w Tomcat and IIS" New topic
Author

can GET but not POST w Tomcat and IIS

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
I am trying to have Tomcat 4.1.18 handle servlets in an IIS 5 / Win2000 Server environment. By following the chapter in Professional Apache Tomcat (very clear) I can now see the Tomcat servlet examples - BUT only the examples that use GET, for examples that POST I get page not found!
By dealing directly with Tomcat on 8080 I can do GET and POST so it must be something about the connection.
Mystified
Bill
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

AFAIK,
There shouldn't be any problem in getting POST requests to work. Are you sure you are handling them in the doPost method of your servlet?
- Manish
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Yes - not only am I working with servlets that have been running on my site www.wbrogden.com on Tomcat for months, and on www.lanw.com for over a year (JRun 3.1), but I tested the Tomcat servlet samples in the /examples/ - the ones that use GET work fine. The cookies example works with the first GET that creates a form but when the response that uses POST fails with a page not found error. Furthermore, when talking directly to Tomcat on 8080, everything works.
I did a search on Google for something like "Tomcat on IIS can GET but not POST" and got a number of hits, but every one I followed up was never resolved, including one at Suns Java developer site!
I figure it has to be the configuration of the connector somehow but I can't find anything in IIS that would be related... Sure hope I don't have to do the "Its Microsoft - try reinstalling everything" dance!
Bill
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
AHA - it looks like the problem was security settings used in the URLScan filter. I think this was installed by the IIS "lockdown" program. The settings were to allow only HEAD and GET requests. Wasted a lot of time on that one.
Bill
Betsy Allen
Greenhorn

Joined: Aug 19, 2005
Posts: 3
I'm having a similar problem. I can get dynamic and static pages using the connector, but I'm getting "page cannot be displayed" (after a long delay) on form pages. The tomcat console shows a timeout. I'm not familiar with the urlScan or the lockdown program. Can you summarize what you did to fix this problem?

Thanks in advance for your help.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
As that was over 2 years ago and I no longer have direct access to the machine in question, I have to rely on my notes.
It appears that at the time there was a MS Security Tool Kit which included a IIS Lockdown Tool iislockd.exe (v2.1 of Oct 2002) -when run it fiddled with various IIS settings. A file "URLScan.ini" was installed or modified that had settings controlling the types of requests allowed. Apparently modifying settings in this file restored use of POST requests.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can GET but not POST w Tomcat and IIS
 
Similar Threads
Display IIS based errors for invalid jsp pages
Configuring Tomcat 4 with IIS 6
Server returned HTTP response code: 405 for URL: http:??? nested exception is:
please dont overlook this question. Will tomcat work in xp home edition?
How Tomcat Works book - development question