• 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

URLs without any extension

 
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In our website, we are having urls like

www.mywebsite.com/XYZ/login.htm. The point is they have extension like .htm.

While JR has url like

https://coderanch.com/forums/f-50/JSP

I am wondering if there is any significant benefit of having urls like JR.

Thank you.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only reason to have file extensions would be if you're serving actual files, and the server determines the type of file based on the file name. For the Ranch URL you cite, there is no actual file -- the page is generated dynamically by a servlet. It's not that there's a file with no extension, it's that there's no filename involved at all.
 
Saurabh Pillai
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ernest Friedman-Hill wrote:For the Ranch URL you cite, there is no actual file -- the page is generated dynamically by a servlet.



Yes, servlet would fetch the data but , no JSP atall for page structure and populating data?

 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the Saloon, nope. No JSPs. Freemarker templates.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saurabh Pillai wrote:

Ernest Friedman-Hill wrote:For the Ranch URL you cite, there is no actual file -- the page is generated dynamically by a servlet.



Yes, servlet would fetch the data but , no JSP atall for page structure and populating data?



That's not what was said. A servlet responds with HTML. How that HTML is rendered is besides the point; whether it is JSP, Freemarker, etc. The point is, a request was sent to a servlet, not a file.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right. And it's better not to exposure your choice of implementation language in the URL anyway. That way you can change it without changing URLs.
 
Saurabh Pillai
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gregg Bolinger wrote:The point is, a request was sent to a servlet, not a file.



Hello Gregg, if you map login.htm to LoginSevlet then also request is sent to servlet. And it is also possible to have virtually any url in order to hide server side framework.

I was just curious, if this type of urls https://coderanch.com/forums/posts/quote/0/2445384 add any benefit?

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saurabh Pillai wrote:Yes, servlet would fetch the data but , no JSP atall for page structure and populating data?


Even if JSPs were used, a properly structured web application will not show the .jsp extension because the JSPs will be hidden behind a forward.
 
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saurabh Pillai wrote:I was just curious, if this type of urls https://coderanch.com/forums/posts/quote/0/2445384 add any benefit?



They are semantic. Jeanne pointed out the main advantage.

The advantage the extension had (sic past tense), besides when serving static files: Broken servers and clients (i.e. browsers) treated a document by extension, not by content type. So in earlier times some browsers would offer you to save a file instead of presenting it because the browser didn't know what to do with it without extension. Oh, and there where some server that determined the content type by extension and set it "automagically" so you didn't have to care for that. One of the situations where it would have been better to let the system fail so the cause gets fixed.

Broken clients, broken servers. Long time gone.
 
reply
    Bookmark Topic Watch Topic
  • New Topic