tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Garrett" <Johns...@cbsnews.com>
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
http://www.myserver.com 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 http://www.myserver.com,
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/workers.properties 
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 workers.properties 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
this:

try
{
	updateDatabase( req ); //My own method
}
catch( SQLException e )
{
	req.setAttribute( "error", "true" );
	ServletContext context = getServletContext();
	RequestDispatcher dispatcher =
context.getRequestDispatcher("/start.jsp");
	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 http://www.myserver.com/start.jsp.  I could use:

response.sendRedirect("/start.jsp");

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
send SOMETHING.

Thanks in advance, kids...

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message