Re: getInitParameter null in custom tag test

Kazuhito SUGURI <[email protected]> Wed, 22 Aug 2007 19:41:24 +0900 (JST)
Newsgroups gmane.comp.jakarta.cactus.user
Message-ID <[email protected]>
Hi David,

In article <[email protected]>,
Thu, 16 Aug 2007 09:48:13 -0700 (PDT),
davids_k <[email protected]> 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