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

Question (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






---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Question (Struts 1.1 - Commons 1.5)

Posted by Lukas Bradley <lu...@somnia.com>.
> Do have following line in your file?
> private String loginRequired;

Presently no, but even when I do, the functionality is not guaranteed.

Side topic -- I know what you're getting at, but if it is declared as
private, how can reflection help?

What I really REALLY want is a boolean declared that will automatically get
parsed and set with a string.

private boolean loginRequired ;

public void setLoginRequired(String pString)
{
   loginRequired = new Boolean(pString).booleanValue() ;
}

But this does NOT work.

Lukas




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Question (Struts 1.1 - Commons 1.5)

Posted by Navjot Singh <na...@net4india.net>.
Do have following line in your file?

private String loginRequired;


|-----Original Message-----
|From: Lukas Bradley [mailto:lukas@somnia.com]
|Sent: Saturday, May 10, 2003 7:57 PM
|To: struts-user@jakarta.apache.org
|Subject: Question (Struts 1.1 - Commons 1.5)
|<action><set-property/></action>
|
|
|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
|
|
|
|
|
|
|---------------------------------------------------------------------
|To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
|For additional commands, e-mail: struts-user-help@jakarta.apache.org
|
|

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org