aspose file tools*
The moose likes JSP and the fly likes Creating jsp file without .jsp extension Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Creating jsp file without .jsp extension" Watch "Creating jsp file without .jsp extension" New topic
Author

Creating jsp file without .jsp extension

nirjari patel
Ranch Hand

Joined: Apr 23, 2009
Posts: 374
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

Joined: Mar 28, 2007
Posts: 403
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 ?

Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
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.


Ping & DNS - my free Android networking tools app
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Creating jsp file without .jsp extension