You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Affan Qureshi <qu...@etilize.com> on 2002/10/31 13:20:11 UTC

Basic question

A rather basic question.
I want to accomplish in my JSP:

if((request.getParameter("ext")!=null)||(request.getParameter("ext").equals(
"0")))
{
    /* do Something */
}
else
{
    /* do Something else */
}

Using the <logic:equals> tag I write

<logic:equals parameter="ext" value="0">


</logic:equals>
<logic:equals parameter="ext" value="1">


</logic:equals>

But first this is not an "else" equivalent and secondly it does not account
for "null" if the parameter is not found in request.
What is the solution?

Thanks for your time on this silly question.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Basic question

Posted by Affan Qureshi <qu...@etilize.com>.
I guess i can do:
                    <logic:present parameter="ext">
                        <logic:equal parameter="ext" value="0">
                                <bean:write ....../>
                        </logic:equal>
                    </logic:present>

for
if((request.getParameter("ext")!=null)||(request.getParameter("ext").equals(
"0")))
but still I can't figure out the "else" clause. I dont want to insert
another set of <logic:present ...> and <logic:equal> tags with inverse
conditions cause that will introduce another "if" instead of the "else"
clause.

----- Original Message -----
From: "Affan Qureshi" <qu...@etilize.com>
To: "struts-user" <st...@jakarta.apache.org>
Sent: Thursday, October 31, 2002 5:20 PM
Subject: Basic <logic:equals> question


> A rather basic question.
> I want to accomplish in my JSP:
>
>
if((request.getParameter("ext")!=null)||(request.getParameter("ext").equals(
> "0")))
> {
>     /* do Something */
> }
> else
> {
>     /* do Something else */
> }
>
> Using the <logic:equals> tag I write
>
> <logic:equals parameter="ext" value="0">
>
>
> </logic:equals>
> <logic:equals parameter="ext" value="1">
>
>
> </logic:equals>
>
> But first this is not an "else" equivalent and secondly it does not
account
> for "null" if the parameter is not found in request.
> What is the solution?
>
> Thanks for your time on this silly question.
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Basic question

Posted by Affan Qureshi <qu...@etilize.com>.
But this is
if(true){    /* do somethig*/  }

if(false) {/* do something else */}

not
if(true)
{    /*do something*/ }
else
{    /*do something else    */}

Or is it?

----- Original Message -----
From: "Marcus Biel" <Ma...@bmw.de>
To: <st...@jakarta.apache.org>
Sent: Thursday, October 31, 2002 6:05 PM
Subject: Re: Basic <logic:equals> question


> if: <logic:equal>
> else: <logic:notEqual>
>
> marcus
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Basic question

Posted by Marcus Biel <Ma...@bmw.de>.
of course!
> if true: <logic:equal>
> else <logic:notEqual>
>

this should already "equal" tell you.

3 equals 3 = true.

cya,

marcus

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Basic question

Posted by Marcus Biel <Ma...@bmw.de>.
if: <logic:equal>
else: <logic:notEqual>

marcus

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>