• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating jsp file without .jsp extension

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By mistake I created a jsp file without .jsp extension in CMS and deployed it on runtime environment.



Now , when I used this jsp, it didnt give an error. But it returned "x" and "=image_alt" instead of image. So how does a file without an extension get called ?
When I tried to open the same file without extension on local m/c , it asked me to select application to open this file. When I selected internet explorer, it displayed entire code in the browser.

My confusion is

1) If "noExtension" file is deployed on runtime in place of "noExtension.jsp", and if"noExtension.jsp" is called by the application, how does "noExtension" get called ?

2) When "noExtension" gets called by the server, which application is used to open this file. Since this file does not have an extension, its a binary file. So it should ask for an application to open this file.

thanks
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you tell me which framework are you using for your application ? Is it servlet, struts or spring or some other one ?

if possible, can you post contents of web.xml file ?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) If "noExtension" file is deployed on runtime in place of "noExtension.jsp", and if"noExtension.jsp" is called by the application, how does "noExtension" get called ?

... by using the same URL without the ".jsp" extension. Maybe I'm misunderstanding the question?

2) When "noExtension" gets called by the server, which application is used to open this file. Since this file does not have an extension, its a binary file. So it should ask for an application to open this file.

What do you mean by "called by the server"? If you mean that its URL is accessed, and so the server is asked to serve it, it will just stream the bytes of the file to the browser. Not having an extension has nothing to do with being binary or text - neither server nor browser knows what type of file it is (and they don't really care, either). That being the case, most likely no content type will be specified by the server, or maybe an incorrect one, so what the browser does with it depends on how it is set up for that case.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic