You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Glenn Golden <gg...@umich.edu> on 2002/02/08 21:38:35 UTC

${webappRoot}

In the TurbineResources.properties, you can include text like:

${webappRoot}

which gets expanded to the file system path to jetspeed...

First, does anyone know what code does this expansion?

Second, I need to be able to get at this information in a Portlet, or a
VelocityAction class.  Is it hidden somewhere in the parameters to
buildNormalContext() in the Context or RunData?

I need the file system path, as well as a URL to the docroot root of
Jetspeed.

I tried to include this text in the .xreg file, in the portlet's parameters,
but it is not expanded.

Thanks!

- Glenn

--------------------------------------------
Glenn R. Golden, Systems Research Programmer
University of Michigan School of Information
ggolden@umich.edu           734-615-1419
http://www-personal.si.umich.edu/~ggolden/
--------------------------------------------



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: ${webappRoot}

Posted by David Sean Taylor <da...@bluesunrise.com>.
Take a look at Turbine servlet's init() method in Turbine.java, its all
there.
(get the source from cvs - the jakarta-turbine-2 project)

All it does is get the servlet context and get the real path for ""
Some app servers return 'null' for getRealPath(), which is allowed in the
servlet api.
One case would be where a webapp is ran directly from a WAR file without
expanding to the file system.
Other cases are that for some unknown reason to us, the app server vendor
interpreted the spec to always return null :(

The usual approach to getting resources from a servlet is to call
context.getResource or context.getResourceAsStream

> I need the file system path,

getRealPath, when it works

Also look at ${applicationRoot} as a workaround for those nasty app servers
that don't support getRealPath
You can hardcode the path in your web.xml

> as well as a URL to the docroot root of
> Jetspeed.

DynamicURI() in java code via turbine
<dynamicUri> as a jetspeed-jsp custom tag

In Velocity, from Jetspeed's tools, there's $link and $jink, or this one is
nice:

$clink.External    - gives the full URL     ->
http://localhost:8080/jetspeed/portal
$clink.Absolute    - gives the relative URL -> /jetspeed

> -----Original Message-----
> From: Glenn Golden [mailto:ggolden@umich.edu]
> Sent: Friday, February 08, 2002 12:39 PM
> To: jetspeed user (E-mail)
> Subject: ${webappRoot}
>
>
> In the TurbineResources.properties, you can include text like:
>
> ${webappRoot}
>
> which gets expanded to the file system path to jetspeed...
>
> First, does anyone know what code does this expansion?
>
> Second, I need to be able to get at this information in a Portlet, or a
> VelocityAction class.  Is it hidden somewhere in the parameters to
> buildNormalContext() in the Context or RunData?
>
> I need the file system path, as well as a URL to the docroot root of
> Jetspeed.
>
> I tried to include this text in the .xreg file, in the portlet's
> parameters,
> but it is not expanded.
>
> Thanks!
>
> - Glenn
>
> --------------------------------------------
> Glenn R. Golden, Systems Research Programmer
> University of Michigan School of Information
> ggolden@umich.edu           734-615-1419
> http://www-personal.si.umich.edu/~ggolden/
> --------------------------------------------
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>