1

From what I understand a jsp is responsible for dynamically generating html pages, which are later sent to the client browser for viewing. But then why do browsers show a .jsp extension while viewing some pages? Is it possible to view a .jsp file in a browser?

2 Answers 2

2

But then why do browsers show a .jsp extension while viewing some pages?

Because, traditionally, JSP files have .jsp file extensions, and URLs map directly onto files on a filesystem (these days the front controller pattern means you see less of that).

Is it possible to view a .jsp file in a browser?

Not an arbitrary one. Servers execute server side programs and return the output to the client, not the program itself.

Sign up to request clarification or add additional context in comments.

2 Comments

So the .jsp is only because of mapping, but basically the file that browser receives is pure html/css/js?
Yes. HTTP clients care about Content-Type headers, not things that look like they might be file extensions in URLs.
0

You need to have a server to view jsp files. I think you can find your answer here

6 Comments

You have to change .html to .jsp
If I have .jsp in the url, does that not mean the .jsp file actually reached my browser from the server(located elsewhere)? How did the jsp reach my browser in the first place? Werent jsps meant to output an html page, which would later be sent to the client?
You have to create a server and put the .jsp in the server directory, then the server will load it from there.
Load it and? afterwards?
are u sayin it will send .jsp file to client browser?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.