cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JD Daniels" ...@datatrio.com>
Subject RE: XSP logic if failing
Date Thu, 20 Nov 2003 19:18:57 GMT
Thanks !!

PHP background :S:S heh heh

-----Original Message-----
From: Christopher Painter-Wakefield [mailto:paint007@mc.duke.edu]
Sent: Thursday, November 20, 2003 10:09 AM
To: users@cocoon.apache.org
Subject: Re: XSP logic if failing






You can't do String equality this way in Java.  Try this instead:
      if (!("Manager".equals(type))) { ... }

The = for Strings is an Object identity test, not a value comparison test.

-Christopher



|---------+---------------------------->
|         |           "JD Daniels"     |
|         |           <jd@datatrio.com>|
|         |                            |
|         |           11/20/2003 01:58 |
|         |           PM               |
|         |           Please respond to|
|         |           users            |
|         |                            |
|---------+---------------------------->

>---------------------------------------------------------------------------
-----------------------------------|
  |
|
  |       To:       "Cocoon Users" <users@cocoon.apache.org>
|
  |       cc:
|
  |       Subject:  XSP logic if failing
|

>---------------------------------------------------------------------------
-----------------------------------|




<xsp:logic>
String str="";
String type = session.getAttribute("userRole").toString();
if ( type != "Manager")
{
             str=" AND tasks.assignedTo='" + session.getAttribute("userId")
+ "'";
}
             <xsp:attribute name="title">Tasks :: Role =
<xsp:expr>type</xsp:expr></xsp:attribute>
</xsp:logic>

For some reason, this if block will ALWAYS fail... even when the session
attribute IS Manager. (The xsp:attribute gets put into my page title, and
"Manager" comes out properly.. but the if block stills fails...


Any Ideas?

JD


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message