cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: web.xml init-params
Date Mon, 17 Nov 2003 21:34:42 GMT
Upayavira wrote:

> Jeremy Quinn wrote:
>
>> Hi All
>>
>> I am trying to access init-params from web.xml, in a FlowScript, and 
>> all I get are nulls.
>>
>> I try this:
>>
>> var smtpHost = cocoon.context.getInitParameter ("smtp-host");
>>
>> with this in my web.xml:
>>
>>     <init-param>
>>       <param-name>smtp-host</param-name>
>>       <param-value>smtp.host.org</param-value>
>>     </init-param>
>>
>> I can't get any of the init-params from web.xml ....
>>
>> Any suggestions?
>
>
> 'Fraid it's not that simple. If you look at the code in the 
> CocoonServlet, I think you'll see that each init param is handled 
> independently, with the init parameters being put into the app context 
> within the init method. Unless you're prepared to subclass the 
> CocoonServlet, I think you're going to have to find another way of 
> getting hold of your initialisation parameters.
>
> Sorry.

You could use a global variable in the sitemap <global-variables/> 
element, and then pass the value, using the global: input component, 
into the flow as a parameter. Just a thought.

Regards, Upayavira



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message