You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Smith <ri...@mindspring.com> on 2001/04/13 03:25:22 UTC

.do files and Apache conf

I'm trying to set up Struts on a virtual hosting site and have been
having a friendly debate with my ISP on the correct way to have .do
files work when running Tomcat with Apache. I'm using mod_jk at home and
have JkMount /struts-example/*.do ajp12 set up and .do files are handled
properly. On my hosting site my ISP feels I should be able to modify the
web.xml file to map .do files without having to include either a handler
for mod_jserv or a JkMount for mod_jk even though they are running
Tomcat with Apache. 
I understand I need the web.xml mapping which is already set up in the
struts-example web.xml file but isn't it true that unless Apache knows
to pass a file with a .do extension to Tomcat it will never get to the
point of checking the mapping in the web.xml file. That is the behavior
I am seeing and I would appreciate if someone could correct me on this
if I'm mistaken or please provide confirmation that I can take back to
my ISP and get this resolved. If there is a way to access .do files
without modifying the Apache conf file I would love to hear how to do
it. TIA.

Rick

Re: .do files and Apache conf

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 12 Apr 2001, Rick Smith wrote:

> I'm trying to set up Struts on a virtual hosting site and have been
> having a friendly debate with my ISP on the correct way to have .do
> files work when running Tomcat with Apache. I'm using mod_jk at home and
> have JkMount /struts-example/*.do ajp12 set up and .do files are handled
> properly. On my hosting site my ISP feels I should be able to modify the
> web.xml file to map .do files without having to include either a handler
> for mod_jserv or a JkMount for mod_jk even though they are running
> Tomcat with Apache. 
> I understand I need the web.xml mapping which is already set up in the
> struts-example web.xml file but isn't it true that unless Apache knows
> to pass a file with a .do extension to Tomcat it will never get to the
> point of checking the mapping in the web.xml file. That is the behavior
> I am seeing and I would appreciate if someone could correct me on this
> if I'm mistaken or please provide confirmation that I can take back to
> my ISP and get this resolved. If there is a way to access .do files
> without modifying the Apache conf file I would love to hear how to do
> it. TIA.
> 

You are correct in your understanding.

The default way that mod_jk (and mod_jserv) are set up is to forward
*only* requests that match "*.jsp" or "/servlet/*" to Tomcat for
processing, and to handle all other requests itself.  You need to modify
your mod_jk configuration to make sure that "*.do" requests are forwarded
as well.

Note that you still need the servlet mapping entry in your web.xml file to
make Tomcat do the right thing.

> Rick
> 

Craig