jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kenney Westerhof <fo...@neonics.com>
Subject Re: Changing a property in the context
Date Mon, 23 Jan 2006 19:37:09 GMT
On Mon, 23 Jan 2006, Javier Gutierrez wrote:

Hi,

> Hello.
>
> I am trying to change a context property for the unit
> test of a Servel. First, I wrote next code:

Servel = servlet?


> ServletContextWrapper context = (ServletContextWrapper
                        ^^^^^^^

> ) config.getServletContext();
> context.setInitParameter ("dataconexion",
> "tralalala");
>
> However, when initiating my Servlet with:
>
> myServlet.init (config);
                  ^^^^^^

context != config.. what is config? dit you set the parameter there?

> The property was unchanged. Looking at the code of
> AbstractServletConfigWrapper I have found that it
> return a new copy of the context when calling
> getServletContext(), so my change is not stored in the
> configuration.

That might be, but that's not what's causing this.


> is there any way to change a property of the context ?

Yup, you did it right.

However, you are probably reading the value from the ServletCONFIG object,
not the ServletCONTEXT object, and you didn't set it there..

Hope this helps!

-- Kenney


> How can I do it?
>
> Thank you very much.
>
>
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

Mime
View raw message