• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating jsp file without .jsp extension

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic