RE: Tomcat and Ultradev produced pages. response.sendRedirect problem.
The code that Ultradev produces has a couple of problems. First, there is a CR-LF which is taken as HTML between the first and second lines. Emitting HTML will most likely cause default HTML headers to be issued. Second, there is NO return; after the redirect, so the program continues on its merry way producing the HTML that is supposed to be stopped. Add return; after the redirect. Close up the CR-LFs between % and %, putting the spaces in the java where they are relatively harmless. Otherwise you have a race condition between the headers and the HTML with unreliable results, not even reliable failure. EXAMPLE: %@page contentType=text/html; charset=iso-8859-1 language=java import=java.sql.*% % ... response.sendRedirect(response.encodeRedirectURL(MM_authFailedURL)); } % // no return;, so code here is executed. -Original Message- From: Paul Downs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 19, 2001 9:38 AM To: tomcat Subject: Tomcat and Ultradev produced pages. response.sendRedirect problem. Hi, We have several customers using Ultradev to produce jsp for their site, everything seems fine, especially if you use non IE browsers. However for response.redirect we get either, the original page after a submission then some garbled cache type data and then the correct destination page. Or for simple links you occasionally get the strange cache data. It looks like this: HTTP/1.1 200 Date: Tue, 11 Sep 2001 16:31:26 GMT Server: Apache Keep-Alive: timeout=15, max=99 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 a4e I know how to massage to the jsp to stop this, with the original line commented out: response.setStatus( 301 ); response.setHeader( Location, MM_editRedirectUrl ); response.flushBuffer(); //response.sendRedirect(response.encodeRedirectURL(MM_editRedirectUrl)); However massaging UltraDevs code all the time is not really practical! :) My question is what causes this behaviour? I presume the other browsers never display it, or display correctly because they don't show anything until the html or Content-Type: label. So seeing as we cannot alter Ultradevs behaviour and we definately cant alter IE's how do I get tomcat stop this? With our previous servlet runners i never experienced this. *phew* Long post Thanks if you made it this far. Paul
RE: Tomcat 4.0: Can webapps dir contain links?
What I have done, that works with 3.2.1 and 3.2.2 at least. And no, I don't really like it. # mkdir /usr/local/jakarta-tomcat/webapps/user # mkdir /usr/local/jakarta-tomcat/webapps/user/META-INF # ln -s /usr/local/jakarta-tomcat/webapps/user /home/user and get the ownership straight. I think there is some security problem with tomcat following symlinks. -Original Message- From: Robert Evans [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 14, 2001 11:34 AM To: [EMAIL PROTECTED] Subject: RE: Tomcat 4.0: Can webapps dir contain links? Thanks for the interest. I am setting up a separate context for each student. The problem is that Tomcat doesn't want to follow the soft link (Solaris) to the student's directory. Bob At 10:58 AM 6/13/2001 -0400, you wrote: Why can't you set up a separate context for each student? In server.xml, you could set the doc base in each context to the appropriate student's directory. -Original Message- From: Robert Evans [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 13, 2001 10:28 AM To: [EMAIL PROTECTED] Subject: Tomcat 4.0: Can webapps dir contain links? Greetings, I am trying to set up a Tomcat server to be used for some web development classes. I would like to have each student have there own webapp, so that in the webapp dir there would be a link to their public_html directory. In Tomcat4B5, it seems as though tomcat will not follow a soft link to the students home directory. If I make a new directory in webapps, it works fine, but the link gives me a 403 application not available message. If anyone has set up a system like this, I would greatly appreciate their help Bob Evans Johns Hopkins University
RE: tomcat and linux
This is not as virtual as you would want it, but if you can stand www.abc.com/abc/whatever # mkdir /usr/local/jakarta-tomcat/webapps/abc # mkdir /usr/local/jakarta-tomcat/webapps/abc/META-INF # ln -s /usr/local/jakarta-tomcat/webapps/abc /home/abc # adduser abc # passwd abc ... # chown -R abc:abc/usr/local/jakarta-tomcat/webapps/abc -Original Message-From: Graffitti [mailto:[EMAIL PROTECTED]]Sent: Wednesday, June 12, 2002 7:23 AMTo: [EMAIL PROTECTED]Subject: tomcat and linux I am using tomcat 3.2 on linux. I want to virtual hosting in TOMCAT so thatevery domain can upload the servlet and JSP files in its own directory. Nowwe are uploading all the servlet and jsp files in the root of tomcatcontainer.But now we have 5 domains in server but we have to upload the servlet andjsp files into root of tomcat.But we want every domain can upload the files into its own domain. Likewww.abc.comHow can we do it. Please help me.