Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Specifying JSP File Name  RSS feed

 
Dima Riabin
Greenhorn
Posts: 20
MyEclipse IDE Windows Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, this is relatively simple question, but I can't seem to find it on my own
I remember, some time ago, working on a project, where we used to use a tag or a scriplet, or something of sorts, so that when the application is running you can do 'View Source' in the browser, on any page and it would tell (I think in the header somewhere) you what JSP file is responsible for rendering this very page content.

I am at a poing where I could really use this now, but I can't remember what was it, that we used ina JSP file to expose it's name. Can anybody help?
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it adds anything by default.
I guess you could add something to a JSP to have it render out to the response.

Something like:


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Except that in a properly structured web app, that will give the URL of the controller.

Of what use is the JSP name?
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure request.getRequestURI() gets the URI of the resource currently being executed.

If you want the original URI requested (ie the URI of your controller), it is stored in the request attribute: javax.servlet.forward.request_uri (ref: SRV.8.4.2)


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's the "slap forehead" smilie? I think you are correct but am not in a position to test it right now.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!