You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Evan Swanson <Ev...@gmd.fujitsu.com> on 2001/10/25 00:21:17 UTC

File Download - CSV question


I wrote an application that for Tomcat 3.2 running on window. In the HTML
the is a reference ( <A HREF="/filname.csv"> ) to the filename. 
When I run this on windows I get a popup "save as" selection box. 
When I run this on Tomcat4.0 on Unix it no longer gives me the selection box
but instead displays the data on the screen.

Is this a difference between TC32 adn TC40 or Unix / Windows.
Is this configurable.


Thanks in advance.


Re: Can't open InputStream to manager??

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 25 Oct 2001, Yoav Shapira wrote:

> Date: Thu, 25 Oct 2001 09:33:15 -0400
> From: Yoav Shapira <sh...@mpi.com>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: Can't open InputStream to manager??
>
> Hi there,
>
> I have a servlet that tries to do something like:
>
> URL url = new
> URL("http://manageruser:managerpassword@myserver.mydomain:myport/manager/list");
> URLConnection con = url.openConnection();

Try adding:

  con.setDoInput(true);
  con.connect();

here.

> BufferedReader bin = new BufferedReader(new
> InputStreamReader(con.getInputStream);
>
> The third line throws an exception.  The connection itself is fine,
> I can call stuff like con.getContentLength() and it works (correctly)
> without a problem.
>
> Is the manager app coded specifically to disallow opening stream to it?
> Has anyone else tried/encountered something like this?

There's nothing special in Manager that would do this (although you're
going to have to include an appropriate "Authorization" header in your
request to bypass the 401 response asking for BASIC authentication).  It's
more likely to be related to the order of calls on your URLConnection --
see the javadocs for java.net.URLConnection (and the Networking Trail in
the online tutorial at <http://java.sun.com/docs/books/tutorial>) for more
information on this.

>
> Thanks!
>
> Yoav Shapira
> Millennium Pharmaceuticals
>

Craig



Can't open InputStream to manager??

Posted by Yoav Shapira <sh...@mpi.com>.
Hi there,

I have a servlet that tries to do something like:

URL url = new
URL("http://manageruser:managerpassword@myserver.mydomain:myport/manager/list");
URLConnection con = url.openConnection();
BufferedReader bin = new BufferedReader(new
InputStreamReader(con.getInputStream);

The third line throws an exception.  The connection itself is fine,
I can call stuff like con.getContentLength() and it works (correctly)
without a problem.  

Is the manager app coded specifically to disallow opening stream to it?
Has anyone else tried/encountered something like this?

Thanks!

Yoav Shapira
Millennium Pharmaceuticals