Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 86590 invoked from network); 11 Dec 2002 16:22:26 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 11 Dec 2002 16:22:26 -0000 Received: (qmail 9990 invoked by uid 97); 11 Dec 2002 16:23:15 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 9964 invoked by uid 97); 11 Dec 2002 16:23:14 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 9951 invoked by uid 98); 11 Dec 2002 16:23:14 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <5DE7B60BFBA5D411B961000629D5225552D738@NYCCNDX3> From: "Johnson, Garrett" To: 'Tomcat Users List' Subject: Tomcat/HTTPD Integration Date: Wed, 11 Dec 2002 11:23:26 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: For additional commands, e-mail: