[Yanel-dev] what is the method Object Resource.getParameter()

Josias Thöny josias.thoeny at wyona.com
Tue Nov 13 16:57:30 CET 2007


Michael Wechner wrote:
> Hi
> 
> What is the following method good for?
> 
> 
>   /**
>     * Gets the parameter with the given name.
>     * @param name
>     * @return parameter object or null if no parameter with this name 
> exists.
>     */
>    public Object getParameter(String name) {
>        return this.parameters.get(name);
>    }
> 

The setParameter and getParameter methods allow to pass parameters to a 
resource. This is used when one resource is using another resource, 
either via SourceResolver or via ResourceManager.

Before these methods existed, the resources were accessing the request 
to read the request parameters. But if one resource was using another 
one, there was no way to override or manipulate the request parameters.
This is now possible with the get/setParameter methods.

It is used for example to pass the path of the original resource to an 
xincluded resource, so it's possible to generate correct relative links 
within an xincluded fragment.

The parameters are initialized by the ResourceManager. It takes all 
request parameters and adds them to the resource.

hth,
josias


> 
> thanks
> 
> Michi
> 



More information about the Yanel-development mailing list