aspose file tools
The moose likes JSP and the fly likes shorter way to access context path using EL Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "shorter way to access context path using EL" Watch "shorter way to access context path using EL" New topic
Author

shorter way to access context path using EL

Kantutan Tayo
Greenhorn

Joined: Oct 07, 2005
Posts: 22
is there a shorter (built-in) way to access the context path using EL
i.e. shorter version of ${pageContext.request.contextPath}?
just wondering. because i have too much on my pages. i know it can be done by assigning some constant string = request.getContextPath(), so don't suggest that idea. :\

NOTE: im looking for a built-in method.


SCJP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13



Now you can use ${contextPath} on the rest of the page.

Otherwise, no.
[ October 07, 2005: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Kantutan Tayo
Greenhorn

Joined: Oct 07, 2005
Posts: 22
yeah, im already doing that. so no other way, eh?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

Not built in. You could also set up a scoped variable in the controller. Or, since it will be invariant throughout the web app's life cycle, store it as an application-scoped variable at web app startup.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: shorter way to access context path using EL
 
Similar Threads
Correct specification of javascript library location
When you are using EL, do we HAVE to explictly write servlet code?
Accessing servlet-config parameter through EL
Context Root of WebApplication in javascript
EL Help...