This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Creating jsp file without .jsp extension  RSS feed

 
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
 
Ranch Hand
Posts: 405
  • 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 ?
 
Rancher
Posts: 42975
76
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!