You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Lukas Bradley <lu...@somnia.com> on 2003/05/11 06:41:07 UTC

[Struts 1.1 - Commons 1.5]

Using the following within struts-config.xml:

<action ... >
   <set-property property="loginRequired" value="false" />
</action>

Why is the following method on MyActionMapping (extends
ActionMapping) legal?

public String two = "" ;
public void setLoginRequired(String pString)
{
   this.two = pString ;
   System.out.println("setloginRequired " + pString) ;
}

But this not legal?

public boolean one = "" ;
public void setLoginRequired(String pString)
{
   this.one = new Boolean(pString).booleanValue() ;
   System.out.println("setloginRequired " + pString) ;
}

During the startup of Tomcat, the first will diplay all the
System.outs.  With the second example, nothing is there.

The more I play with this, the sketchier it is.... I can't even
pinpoint what makes it NOT work.  Sometimes this does work,
sometimes it doesn't....

public void setLoginRequired(String pString)
{
   this.two = pString ;
   System.out.println("setloginRequired " + pString) ;
   this.one = new Boolean(pString).booleanValue() ;
}

Any ideas?  I'm going source diving......  YUCK.

Lukas




Re: [Struts 1.1 - Commons 1.5]

Posted by Rob Leland <rl...@apache.org>.
Wrong list, but look at your boolean assignment for rthe instance variable
one.

public boolean one = "" ;

Does this really compile ?