tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juha Laiho <>
Subject Re: Servlet Openning as file download
Date Wed, 06 Feb 2008 15:30:02 GMT
Natasha Wright wrote:
> From: toish100@hotmail.comTo: users@tomcat.apache.orgSubject: Date: Wed, 6 Feb 2008 10:00:53
> HiI am running tomcat 5.5 on windows XP; I am attempting to run a servletas a html form
action:<form method="POST" action="BeerSelect"><input type="SUBMIT"></form>When
I click on the submit button a file download box appears where Ican 'save' the file "BeerSelect"
as opposed to routing to the html page I createwithin the servlet class.  I've used tomcat
before & have neverencountered this problem before & it does not seem to appear on
anyforumMy web.xml contains the following:<web-app xmlns=""
   xmlns:xsi=""    xsi:schemaLocation=""
   version="2.4"><servlet>            <servlet-name>Ch3Beer</servlet-name>
           <servlet-name>Ch3Beer</servlet-name>            <url-pattern>/BeerSelect</url-pattern></servlet-mapping></web-app>A
ny light anyone could shed on this would be much appreciated.Natasha Wright 

Mm.. whatever you're using as your mail software is removing all line
breaks form your message, making it rather hard to read.

Anyway, as to your problem; most possibly it is that the BeerSelect servlet
(from Ch3Beer class) is setting some strange content type for the
response document (default content type is text/html, which should
be displayed just fine with the browser).

The other possible solution could be that even though your servlet is
setting text/html, it is outputting some non-html content, and because
of this your browser is deciding to rather offer to save the content
as opposed to displaying it directly.

You could also let your browser save the content and take a look at the
saved file to find out what your servlet actually did send as the
response to submitting the form.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message