Solved

Download JSP file from browser

Posted on 2003-10-31
8
616 Views
Last Modified: 2010-05-18
I know it's a long shot, but is there any way to download a jsp file from a browser? For example, when you type

www.somehost.com/download.jsp

the page won't open but ask you to download this jsp file.

Thanks
0
Comment
Question by:Dmitriy
8 Comments
 
LVL 17

Expert Comment

by:dorward
ID: 9658811
That depends what you mean by the question...

* If you want to look at someone else's JSP without their help: Not possible
* If you want to have your own JSP download rather then run: Server configuration issue
* If you want the output of your own JSP to download rather then display: Set the content-type header to something suitable for the type of data you are sending.
0
 
LVL 3

Author Comment

by:Dmitriy
ID: 9658883
I changed the association of the JSP file to open with the notepad.  Why is the browser still opening the page?  Shouldn't it display it in the notepad?  Can you explain how the opening of JSP takes place?  

I thought that if you associate any extension with any program, this extension will always be opened with this program

Thanks
0
 
LVL 15

Expert Comment

by:VincentPuglia
ID: 9658995
if the browser can open or execute a file extension, it will display the page.
if you want to download the file, zip it (myJSPfile.zip) and then it will be downloaded.
if you want to view it in notepad, rename it *.txt

Vinny
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 17

Expert Comment

by:dorward
ID: 9660221
If its coming from a webserver, the file extension is irrelevent. Its the content type sent by the webserver that the system pays attention to.
0
 
LVL 15

Expert Comment

by:VincentPuglia
ID: 9660239
Hi dorward,

  I'm presuming he wants to make code available for others, not download 'live' pages

Vinny
0
 
LVL 1

Accepted Solution

by:
net99online earned 75 total points
ID: 9661639
the server pages like asp and jsp are processed on the hosting server beore they are sent to the user

there is no way that you can view the source code of the jsp file

you will only view the result of the page processing on the host server
0
 
LVL 17

Expert Comment

by:dorward
ID: 9662402
VincentPuglia: I was referring to his comment, not yours.
0
 
LVL 15

Expert Comment

by:VincentPuglia
ID: 9662805
sorry dorward :)
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question