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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
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: 61199
    
  66



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

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

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 61199
    
  66

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