tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Garrett" <>
Subject Tomcat/HTTPD Integration
Date Wed, 11 Dec 2002 16:23:26 GMT
Ladies and Gentlemen:

I've got 2 problems here:

1.  I've got a webapp sitting in the /webapps/ROOT directory, and I'd like
to be able to access it using Apache HTTPD instead of Tomcat's built-in
server.  However, the way it's set up now, simply typing in will bring up my index.jsp page in Tomcat.  That's
what I want.  How do I instruct apache, when running on top of Tomcat, to do
the same thing?  I want it to get a request for,
realize that the index page is a .jsp, and send the request off to tomcat.
How do I set up the default welcome page in apache to be index.jsp?  Can I
do this with an alias?

My environment:

* Tomcat 4.1
* Apache 2.0
* mod_jk 1.2
* Win2K
* httpd.conf file has these entries appended to the end:

LoadModule jk_module modules/mod_jk.dll
JkWorkersFile conf/ 
JkLogFile logs/mod_jk.log 
JkLogLevel info 
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " 
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories 
JkRequestLogFormat "%w %V %T" 
JkMount /*.jsp worker1
JkMount /*Servlet worker1

and the file is where it should be.

2.  I'm currently instructing my servlet to handle erroneous form data by
sending the user back to the JSP with the form in it, with a flag embedded
within the request.  This let's me force them to resubmit, only with
reminder messages.  The code on the servlet side looks essentially like

	updateDatabase( req ); //My own method
catch( SQLException e )
	req.setAttribute( "error", "true" );
	ServletContext context = getServletContext();
	RequestDispatcher dispatcher =
	dispatcher.forward( req, res );

My question is, how do I get the URL on the client side to reflect the
forwarding?  Right now, the URL in the browser still indicates that they're
being handled by the servlet, while I want it to indicate that they've
returned to  I could use:


However, if I do that, how do I set a PARAMETER for my JSP to read to let it
know we're in an erroneous condition?  That's the critical part.  I need to

Thanks in advance, kids...

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message