jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kazuhito SUGURI <suguri.kazuh...@lab.ntt.co.jp>
Subject Re: getInitParameter null in custom tag test
Date Wed, 22 Aug 2007 10:41:24 GMT
Hi David,

In article <12185070.post@talk.nabble.com>,
Thu, 16 Aug 2007 09:48:13 -0700 (PDT),
davids_k <david.uk.liu@gmail.com> wrote: 
david> I try to set init parameter in custom tag test. However, in the custom tag
david> class, I get null from getInitParameter.
david> 
david> Here is the example:
david> 
david> In test class:
david>     public void setUp(){
david>     	tag=new HelloWorldTag();
david>     	config.setInitParameter("initTest", "Test Init");
david>     	tag.setPageContext(this.pageContext);
david>      }
david> 
david> In HelloWorldTag class:
david> 
david>     public int doStartTag(){
david>          String
david> initTest=this.pageContext.getServletContext().getInitParameter("initTest");
david>          System.out.println(initTest); //This is null.
david>    }

As far as I can see from Cactus code, it doesn't support your use case.

I think I can provide a patch if you can build Cactus jars from code,
although I don't have enough time to commit it to the code-base.

Regards,
----
Kazuhito SUGURI

Mime
View raw message