> Hi,
>
> I have two problems with Tomcat 4.0 which might be caused by bugs:
> All the JSP pages in my project are named "index.jsp", and they are
> spread in different directories of the wepapp. All links of the
> application only reference the directories, and since index.jsp is in
> the welcome-file list, it is executed, i.e. I have a file
> /news/index.jsp and link it as /news/.
> (I link directories instead of the files directly because 1. the user
> does not need to see I'm using JSP and 2. I can replace static
> index.html files with dynamic jsp's and vice versa, without changing any
> of the links.)
>
> The problem is that Tomcat seems to send a redirect to the user's
> browser to load the index.jsp page, and thereby  drops all request
> parameters in the URL!
>
> I think this is not how it's supposed to work. /news/?id=5 should return
> the result of /news/index.jsp?id=5.

Tomcat 4 will return a 302 (temporary redirect) pointing to
/news/path_of_the_welcome_file.
The thing is I don't know if I should include the query parameters in the
Location header (which is not something I'm doing right now).

> The other problem is with a servlet in that application (which also
> works well on Resin), that serves binary data from a database. What it
> does is setting the correct content-type (i.e. image/jpeg) and then
> copying the BLOB data to the ServletOutputStream.
>
> It seems Tomcat prepends the data with the following lines:
> --- snip ---
> Date: Wed, 21 Mar 2001 15:52:56 GMT
> Server: Apache Tomcat/4.0-b1 (HTTP/1.1 Connector)
> Transfer-Encoding: chunked
>
> 400
> --- snap ---
>
> That way the image data gets corrupted. Isn't this information supposed
> to be in the HTTP Headers, and not in my output?

This corruption is produced by an HTTP/1.1 transfer encoding called
chunking. Its support is mandatory in HTTP/1.1. Which HTTP client are you
using ?
If you're directly talking on the socket or using a client without real
support for HTTP/1.1, you may want to make a request using HTTP/1.0 (which
doesn't have chunking), or set the content length of the response (in which
case chunking will not be used).

Remy

Reply via email to