I dont understand. Do you want to also display the
data in "tab deliminated" format in the browser?
If so, then use an HTML table!
<TABLE rows="<%=results.length() %> cols="4">
<%
for (int i=0; i<num_rows; i++;) {
%> <TR>
<TD> <%=results[i].name %> </TD>
<TD> <%=results[i].address%> </TD>
<TD> <%=results[i].city %> </TD>
<TD> <%=results[i].phone %> </TD>
</TR> <%
}
</TABLE>
(the array reference is just for illustration. You should probably use a vector.)
Then also have a download button that goes to a _servlet_ and the
servlet just sends back the tab deliminated file with the appropriate
mime type. That way the browser will see the response as, say, an
excel file and save it correctly. If you want to download, you'll need
a different mime type for the response, otherwise the browser will
just try to display it.
>
>>From: hua ge <[EMAIL PROTECTED]>
>>Reply-To: A mailing list about Java Server Pages specification and
>> reference <[EMAIL PROTECTED]>
>>To: [EMAIL PROTECTED]
>>Date: Wed, 20 Sep 2000 12:48:45 GMT
>>
>>Hi,Gurus
>>
>>I have a jsp page which will use out.write to output data in tab
>>delimited(fixed length column) format.
>><%
>>response.setHeader("Content-Disposition","attachment; filename=
>>exp.txt;");
>>
>>out.write(" following records found from your searching:");
>>....... (the results are writen here in tab delimited format )
>>
>>%>
>>
>>the header is set up this way because we need to pop up a download dialog
>>box so user can download this page to their local disk as default save as
>>exp.txt name shown in the save as box. (it works fine with the exp.txt
>>downloaded and data contained there, but I need to make the data formated
>>there)
>>
>>my goal is when the user open the file they download, it will show the file
>>as a tab delimited(fixed length column) text file such as:
>>
>>name phone address
>>john brown 123-456-7889 123 maple st, md 20821
>>lilly smith 457-154-7854 234 johnson circle, CA 92123
>>
>>my question is how can I write the data in tab delimited format in the jsp
>>page using out.write() as the above shown format? (fixed length column,
>>line
>>return....)
>>
>>highly appreciated if someone give me some sample code or some instruction.
>>
>>
>>_________________________________________________________________________
>>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>>
>>Share information about yourself, create your own public profile at
>>http://profiles.msn.com.
>>
>>===========================================================================
>>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>>JSP-INTEREST".
>>Some relevant FAQs on JSP/Servlets can be found at:
>>
>>http://java.sun.com/products/jsp/faq.html
>>http://www.esperanto.org.nz/jsp/jspfaq.html
>>http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>>http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>Share information about yourself, create your own public profile at
>http://profiles.msn.com.
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets