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"     |
|         |           <[EMAIL PROTECTED]>|
|         |                            |
|         |           11/20/2003 01:58 |
|         |           PM               |
|         |           Please respond to|
|         |           users            |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                          |
  |       To:       "Cocoon Users" <[EMAIL PROTECTED]>                                 
                    |
  |       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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to