473,662 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

csv is taking .jsp extension while export

Hi all

I am exporting some data in .csv format through jsp file it is
exporting the data in csv format but giving the exported file .jsp
extension.
I want .csv extension can anybody help.

Thanks

Megha
Jul 17 '05 #1
4 6549
megha wrote:
I am exporting some data in .csv format through jsp file it is
exporting the data in csv format but giving the exported file .jsp
extension.
I want .csv extension can anybody help.


For most servlet engines, just provide some <servlet-mapping>'s in your
application's web.xml file.
Jul 17 '05 #2
Hi

I am exporting the data through .jsp file in three formats 1. excel,
2. xml
3. csv though for rest 2 it is exporting the data in same format with
proper extension but if i clicked .csv it is exporting in same format
but with.jsp extension. Tell me where exactly in web.xml i have to put
so that it will take the proper extension for all the exports file
without changing the formats of first two formats.

Thanks in advance

Megha
Jeff Schwab <je******@comca st.net> wrote in message news:<Yt******* *************@c omcast.com>...
megha wrote:
I am exporting some data in .csv format through jsp file it is
exporting the data in csv format but giving the exported file .jsp
extension.
I want .csv extension can anybody help.


For most servlet engines, just provide some <servlet-mapping>'s in your
application's web.xml file.

Jul 17 '05 #3
megha wrote:
Jeff Schwab <je******@comca st.net> wrote
I am exporting some data in .csv format through jsp file it is
exporting the data in csv format but giving the exported file .jsp
extension.
I want .csv extension can anybody help.
For most servlet engines, just provide some <servlet-mapping>'s in your
application 's web.xml file.

I am exporting the data through .jsp file in three formats 1. excel,
2. xml
3. csv though for rest 2 it is exporting the data in same format with
proper extension but if i clicked .csv it is exporting in same format
but with.jsp extension. Tell me where exactly in web.xml i have to put
so that it will take the proper extension for all the exports file
without changing the formats of first two format


Please don't top-post; posts are much easier to read when new content
goes below any old content to which it refers. :)

I understand now what you're trying to do. I'm afraid I don't have an
easy answer. You may find one in the reference material for your
server. One quick & dirty alternative would be to generate the content
(xml, csv or excel) to a static file, then provide a link or redirect to
that file. That approach may be undesirable for several reasons,
including security, but it is straight-forward.
Jul 17 '05 #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

megha wrote:
Hi all

I am exporting some data in .csv format through jsp file it is
exporting the data in csv format but giving the exported file .jsp
extension.
I want .csv extension can anybody help.

Thanks

Megha


Hi,
How about, in your JSP, set the following header:

Content-Disposition: attachment; filename=<whate ver>.csv

assuming you want the browser to do the typical open-or-save dialog.
The purpose of this syntax is to tell the browser, with the
"attachment " part, that the file should be saved and not opened
inline, and with the "filename" part, that the filename in the URL is
not the "real" filename of the object.

- --
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAdiBsnwj A8LryK2IRAl3bAK DGUNPvWNdid7qfq 6dDQ36EkQC6HACf UgB3
onb+lUmBZ5jKkVj rV/SUz1U=
=WpUS
-----END PGP SIGNATURE-----
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6651
by: J. Shrimp, Jr. | last post by:
Following code exports tables as text files: For Each tdf In db.TableDefs StrTblName = tdf.Name Me.txtProgName = StrTblName Me.txtProgName.Requery tblAtt = tdf.Attributes moddate = tdf.LastUpdated If Left(StrTblName, 3) <> "tbl" And tblAtt = 0 Then strSQL = "INSERT INTO tmpExport ( Code ) SELECT _
3
1874
by: Simon Burton | last post by:
Hi, I'm having some trouble linking one extension module to another because the linker expects a "lib" prefix and my python modules cannot have this prefix. I found two ways of doing it on a linux box (either symlink or create a dummy .so that links to extension module) but I can get neither of them work on OSX (let alone windows).
0
1526
by: MarkE | last post by:
I'm just getting started on Boost Python and may have missed this obvious looking problem somewhere. Given a c-extension "testext" written using Boost Python containing a base class "Base", a derived class "Derived", and a function "doSomething" which expects a "Derived" parameter, if I pass it a "Base" parameter an exception is thrown. This is a Boost.Python.ArgumentError. My question is how do I catch this error ? I tried the...
4
2524
by: vedrandekovic | last post by:
Hi, I have already install Microsoft visual studio .NET 2003 and MinGw, when I try to build a extension: python my_extension_setup.py build ( or install ) , I get an error: LINK : fatal error LNK1141: failure during build of exports file error: command '"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe"' failed with exit status 1141.What shoud I
1
1572
by: leninv | last post by:
Hi, I have a asp page where I have a Export to Excel button. When I click the button, I get the option to open or save or cancel. When I click on save option I get the save dialogue box and save it. I don't have any problem if I save it with .xls extension, but the problem comes when I save it with .TXT extension. When I open the file saved with .txt extension I am able to see some html code as seen below only part of data is pasted...
1
1612
by: KiranKGone | last post by:
Hi All, We have a requirement to archive ( delete and store on a tape device ) the transaction data which is more than 90 days old. Have written the export commands, followed by the delete commands for all the transaction tables. However, I have a table in which 90% of the data is LOBs. The export is working fine on all the tables ( though slower for LOB table ), however, delete is taking some hours for LOB table, in order to delete a few...
0
1639
by: kavin | last post by:
our Customer used to take export backup of a particular schema, previously it used to finish within 30 Minutes. As of now it is taking almost 12 Hours. Export is consuming more time while taking the backup of three particular tables.This tables contains row sizes of 15 lakhs,one lakhs, 75 lakhs respectively
1
3169
by: kavin | last post by:
our Customer used to take backup all the tables of a particular schema using export utility, previously the export operation used to finish within 30 Minutes. As of now it is taking almost 12 Hours. mainly while taking the backup of three particular tables.This tables contains row sizes of 15 lakhs,one lakhs, 75 lakhs records respectively
0
960
by: Martin Landa | last post by:
Hi, I am writing Python extension in C++, in this extension I am using methods from another Python extension. On Linux I am currently linking my extension with used Python extension -- what is quite ugly. gcc ... -lgdi where gdi is a link to C++ extension imported by 'module'
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8344
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8764
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.