Solved

Download JSP file from browser

Posted on 2003-10-31
8
605 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
 
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
3 Use Cases for Connected Systems

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

 
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

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

929 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now