You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Abdullah <ab...@oilgrains.com> on 2001/02/01 12:51:50 UTC

Invoking parameterized constructor using sueBean tag from a jsp

Hi
can anyone tell me how to invoke a parameterizd constructor using useBean tag
from a jsp

Thanks
Abdullah


Re: Invoking parameterized constructor using sueBean tag from a jsp

Posted by Luc Vanlerberghe <lv...@bvdep.com>.
AFAIK the bean spec requires that a no-arg constructor must exist.

To initialise your bean you must use another method or getter/setter
methods.

You can always include your constructor with arguments as well and let
it call this() (as very first statement) and then the initialisation
method with the arguments.

I'm not sure, but I think you can have java statements (using <% ... %>)
within the <useBean></useBean> tags that will be executed right after
the bean is first instantiated.  Won't look to good, but might be
useful...

Luc

Abdullah wrote:
> 
> Hi
> can anyone tell me how to invoke a parameterizd constructor using useBean tag
> from a jsp
> 
> Thanks
> Abdullah
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org