You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sharath karnati <ka...@yahoo.com> on 2008/06/25 23:04:55 UTC
weird problem tag.
Hi All,
In .jsp file, I'm having following code which is using <s:iterator> tag.
<s:iterator value="userCommentsList" id="usercomment">
<tr>
<td align="center"> <s:property value="#usercomment.projectNm" /> </td>
<td align="center"> <s:property value="#usercomment.subject" /> </td>
<td align="center"> <s:property value="#usercomment.comments" /> </td>
<s:if test="%{deploymentVersion !='All'}">
<td align="center"> <s:date name="#usercomment.closingDate" format="MM/dd/yyyy" /> </td>
</s:if>
</tr>
</s:iterator>
The <s:iterator> tag is showing properties values(projectNm, subject,comments)correctly. 'deploymentVersion' property is not a member of 'usercomment' and when it is having value 'All' still it is displaying '#usercomment.closingDate' value. I think that it is not validating <s:if> condition correctly inside <s:iterator>. If I move this condition outside of <s:iterator> it is working as expected.
Please let me know, how to validate the properties which are not member of <s:iterator> value.
Thanks,Sharath.
RE: weird problem tag.
Posted by Martin Gainty <mg...@hotmail.com>.
agree that should work...
<s:if test="deploymentVersion != 'All'">
<s:set name="title" value="%{'Deployment Version is NOT ALL'}"/>
</s:if>
<s:else>
<s:set name="title" value="%{'Deployment Version is ALL'}"/>
</s:else>
http://struts.apache.org/2.0.11.1/docs/crud-demo-i.html
(another alternative is to push <OGNL> value into a property and then test the value of the property)
HTH
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Wed, 25 Jun 2008 23:12:44 +0200
> From: lukasz.lenart@googlemail.com
> To: user@struts.apache.org; karnatis@yahoo.com
> Subject: Re: weird problem <s:iterator> tag.
>
> > <s:if test="%{deploymentVersion !='All'}">
>
> Maybe use <s:if/> tag instead?
> http://struts.apache.org/2.1.2/docs/if.html
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
The other season of giving begins 6/24/08. Check out the i’m Talkathon.
http://www.imtalkathon.com?source=TXT_EML_WLH_SeasonOfGiving
Re: weird problem tag.
Posted by Lukasz Lenart <lu...@googlemail.com>.
> <s:if test="%{deploymentVersion !='All'}">
Maybe use <s:if/> tag instead?
http://struts.apache.org/2.1.2/docs/if.html
Regards
--
Lukasz
http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: weird problem tag.
Posted by sharath karnati <ka...@yahoo.com>.
Hi Pawel,
Don't know how it is working for you. I'm also having similar environment and having this problem.
I fixed this issue using top for 'deploymentVersion'.
Thanks,
Sharath.
--- On Thu, 6/26/08, Paweł Wielgus <po...@gmail.com> wrote:
From: Paweł Wielgus <po...@gmail.com>
Subject: Re: weird problem <s:iterator> tag.
To: "Struts Users Mailing List" <us...@struts.apache.org>, karnatis@yahoo.com
Date: Thursday, June 26, 2008, 3:16 AM
Hi Sarath,
this is content of my TestAction:
---------------------------------------------------------------------------
public List<String> getMyList() {
ArrayList<String> result = new ArrayList<String>();
result.add("1.");
result.add("2..");
result.add("3...");
return result;
}
public String getDeploymentVersion() {
return "All";
}
---------------------------------------------------------------------------
this is content of my test.jsp
---------------------------------------------------------------------------
Test:<br>
<s:iterator value="myList" id="entr">
entry: <s:property value="entr"/>, <s:property
value="length()"/>
<s:if test="deploymentVersion != 'All'">
not equal
</s:if>
<s:if test="deploymentVersion == 'All'">
equal
</s:if>
<br>
</s:iterator>
---------------------------------------------------------------------------
and this is the output:
---------------------------------------------------------------------------
Test:
entry: 1., 2 equal
entry: 2.., 3 equal
entry: 3..., 4 equal
---------------------------------------------------------------------------
So if i properly understod Your problem i have no such one.
Any thoughts?
My environement: S2 2.0.11.1
Best greetings,
Paweł Wielgus.
On 26/06/2008, sharath karnati <ka...@yahoo.com> wrote:
> The deploymentVersion is from 'action'. I even tried with
<c:if> and it is also having same issue.
>
> Thanks,
> Sharath.
>
> --- On Wed, 6/25/08, Paweł Wielgus <po...@gmail.com> wrote:
>
> From: Paweł Wielgus <po...@gmail.com>
> Subject: Re: weird problem <s:iterator> tag.
> To: "Struts Users Mailing List" <us...@struts.apache.org>,
karnatis@yahoo.com
> Date: Wednesday, June 25, 2008, 5:38 PM
>
>
> Hi Sarath,
> where from this deploymentVersion is from (action, session)?
> Such construction works for me in many places, so i would like to
> replicate this problem.
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2008/6/25 sharath karnati <ka...@yahoo.com>:
> > Hi All,
> >
> > In .jsp file, I'm having following code which is using
> <s:iterator> tag.
> >
> > <s:iterator value="userCommentsList"
> id="usercomment">
> > <tr>
> > <td align="center"> <s:property
> value="#usercomment.projectNm" /> </td>
> > <td align="center"> <s:property
> value="#usercomment.subject" /> </td>
> > <td align="center"> <s:property
> value="#usercomment.comments" /> </td>
> >
> > <s:if test="%{deploymentVersion !='All'}">
> > <td align="center"> <s:date
> name="#usercomment.closingDate" format="MM/dd/yyyy"
/>
> </td>
> > </s:if>
> > </tr>
> > </s:iterator>
> >
> > The <s:iterator> tag is showing properties
values(projectNm,
> subject,comments)correctly. 'deploymentVersion' property is not a
> member of 'usercomment' and when it is having value
'All'
> still it is displaying '#usercomment.closingDate' value. I think
that
> it is not validating <s:if> condition correctly inside
> <s:iterator>. If I move this condition outside of
<s:iterator> it
> is working as expected.
> >
> > Please let me know, how to validate the properties which are not
member
> of <s:iterator> value.
> >
> > Thanks,Sharath.
> >
> >
> >
> >
>
>
>
Re: weird problem tag.
Posted by Paweł Wielgus <po...@gmail.com>.
Hi Sarath,
this is content of my TestAction:
---------------------------------------------------------------------------
public List<String> getMyList() {
ArrayList<String> result = new ArrayList<String>();
result.add("1.");
result.add("2..");
result.add("3...");
return result;
}
public String getDeploymentVersion() {
return "All";
}
---------------------------------------------------------------------------
this is content of my test.jsp
---------------------------------------------------------------------------
Test:<br>
<s:iterator value="myList" id="entr">
entry: <s:property value="entr"/>, <s:property value="length()"/>
<s:if test="deploymentVersion != 'All'">
not equal
</s:if>
<s:if test="deploymentVersion == 'All'">
equal
</s:if>
<br>
</s:iterator>
---------------------------------------------------------------------------
and this is the output:
---------------------------------------------------------------------------
Test:
entry: 1., 2 equal
entry: 2.., 3 equal
entry: 3..., 4 equal
---------------------------------------------------------------------------
So if i properly understod Your problem i have no such one.
Any thoughts?
My environement: S2 2.0.11.1
Best greetings,
Paweł Wielgus.
On 26/06/2008, sharath karnati <ka...@yahoo.com> wrote:
> The deploymentVersion is from 'action'. I even tried with <c:if> and it is also having same issue.
>
> Thanks,
> Sharath.
>
> --- On Wed, 6/25/08, Paweł Wielgus <po...@gmail.com> wrote:
>
> From: Paweł Wielgus <po...@gmail.com>
> Subject: Re: weird problem <s:iterator> tag.
> To: "Struts Users Mailing List" <us...@struts.apache.org>, karnatis@yahoo.com
> Date: Wednesday, June 25, 2008, 5:38 PM
>
>
> Hi Sarath,
> where from this deploymentVersion is from (action, session)?
> Such construction works for me in many places, so i would like to
> replicate this problem.
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2008/6/25 sharath karnati <ka...@yahoo.com>:
> > Hi All,
> >
> > In .jsp file, I'm having following code which is using
> <s:iterator> tag.
> >
> > <s:iterator value="userCommentsList"
> id="usercomment">
> > <tr>
> > <td align="center"> <s:property
> value="#usercomment.projectNm" /> </td>
> > <td align="center"> <s:property
> value="#usercomment.subject" /> </td>
> > <td align="center"> <s:property
> value="#usercomment.comments" /> </td>
> >
> > <s:if test="%{deploymentVersion !='All'}">
> > <td align="center"> <s:date
> name="#usercomment.closingDate" format="MM/dd/yyyy" />
> </td>
> > </s:if>
> > </tr>
> > </s:iterator>
> >
> > The <s:iterator> tag is showing properties values(projectNm,
> subject,comments)correctly. 'deploymentVersion' property is not a
> member of 'usercomment' and when it is having value 'All'
> still it is displaying '#usercomment.closingDate' value. I think that
> it is not validating <s:if> condition correctly inside
> <s:iterator>. If I move this condition outside of <s:iterator> it
> is working as expected.
> >
> > Please let me know, how to validate the properties which are not member
> of <s:iterator> value.
> >
> > Thanks,Sharath.
> >
> >
> >
> >
>
>
>
Re: weird problem tag.
Posted by sharath karnati <ka...@yahoo.com>.
I'm able to fix this problem using 'top'
Thanks,
Sharath.
--- On Wed, 6/25/08, sharath karnati <ka...@yahoo.com> wrote:
From: sharath karnati <ka...@yahoo.com>
Subject: Re: weird problem <s:iterator> tag.
To: "Paweł Wielgus" <po...@gmail.com>, user@struts.apache.org
Date: Wednesday, June 25, 2008, 6:05 PM
The deploymentVersion is from 'action'. I even tried with <c:if>
and it is also having same issue.
Thanks,
Sharath.
--- On Wed, 6/25/08, Paweł Wielgus <po...@gmail.com> wrote:
From: Paweł Wielgus <po...@gmail.com>
Subject: Re: weird problem <s:iterator> tag.
To: "Struts Users Mailing List" <us...@struts.apache.org>,
karnatis@yahoo.com
Date: Wednesday, June 25, 2008, 5:38 PM
Hi Sarath,
where from this deploymentVersion is from (action, session)?
Such construction works for me in many places, so i would like to
replicate this problem.
Best greetings,
Paweł Wielgus.
2008/6/25 sharath karnati <ka...@yahoo.com>:
> Hi All,
>
> In .jsp file, I'm having following code which is using
<s:iterator> tag.
>
> <s:iterator value="userCommentsList"
id="usercomment">
> <tr>
> <td align="center"> <s:property
value="#usercomment.projectNm" /> </td>
> <td align="center"> <s:property
value="#usercomment.subject" /> </td>
> <td align="center"> <s:property
value="#usercomment.comments" /> </td>
>
> <s:if test="%{deploymentVersion !='All'}">
> <td align="center"> <s:date
name="#usercomment.closingDate" format="MM/dd/yyyy" />
</td>
> </s:if>
> </tr>
> </s:iterator>
>
> The <s:iterator> tag is showing properties values(projectNm,
subject,comments)correctly. 'deploymentVersion' property is not a
member of 'usercomment' and when it is having value 'All'
still it is displaying '#usercomment.closingDate' value. I think that
it is not validating <s:if> condition correctly inside
<s:iterator>. If I move this condition outside of <s:iterator> it
is working as expected.
>
> Please let me know, how to validate the properties which are not member
of <s:iterator> value.
>
> Thanks,Sharath.
>
>
>
>
Re: weird problem tag.
Posted by sharath karnati <ka...@yahoo.com>.
The deploymentVersion is from 'action'. I even tried with <c:if> and it is also having same issue.
Thanks,
Sharath.
--- On Wed, 6/25/08, Paweł Wielgus <po...@gmail.com> wrote:
From: Paweł Wielgus <po...@gmail.com>
Subject: Re: weird problem <s:iterator> tag.
To: "Struts Users Mailing List" <us...@struts.apache.org>, karnatis@yahoo.com
Date: Wednesday, June 25, 2008, 5:38 PM
Hi Sarath,
where from this deploymentVersion is from (action, session)?
Such construction works for me in many places, so i would like to
replicate this problem.
Best greetings,
Paweł Wielgus.
2008/6/25 sharath karnati <ka...@yahoo.com>:
> Hi All,
>
> In .jsp file, I'm having following code which is using
<s:iterator> tag.
>
> <s:iterator value="userCommentsList"
id="usercomment">
> <tr>
> <td align="center"> <s:property
value="#usercomment.projectNm" /> </td>
> <td align="center"> <s:property
value="#usercomment.subject" /> </td>
> <td align="center"> <s:property
value="#usercomment.comments" /> </td>
>
> <s:if test="%{deploymentVersion !='All'}">
> <td align="center"> <s:date
name="#usercomment.closingDate" format="MM/dd/yyyy" />
</td>
> </s:if>
> </tr>
> </s:iterator>
>
> The <s:iterator> tag is showing properties values(projectNm,
subject,comments)correctly. 'deploymentVersion' property is not a
member of 'usercomment' and when it is having value 'All'
still it is displaying '#usercomment.closingDate' value. I think that
it is not validating <s:if> condition correctly inside
<s:iterator>. If I move this condition outside of <s:iterator> it
is working as expected.
>
> Please let me know, how to validate the properties which are not member
of <s:iterator> value.
>
> Thanks,Sharath.
>
>
>
>
Re: weird problem tag.
Posted by Paweł Wielgus <po...@gmail.com>.
Hi Sarath,
where from this deploymentVersion is from (action, session)?
Such construction works for me in many places, so i would like to
replicate this problem.
Best greetings,
Paweł Wielgus.
2008/6/25 sharath karnati <ka...@yahoo.com>:
> Hi All,
>
> In .jsp file, I'm having following code which is using <s:iterator> tag.
>
> <s:iterator value="userCommentsList" id="usercomment">
> <tr>
> <td align="center"> <s:property value="#usercomment.projectNm" /> </td>
> <td align="center"> <s:property value="#usercomment.subject" /> </td>
> <td align="center"> <s:property value="#usercomment.comments" /> </td>
>
> <s:if test="%{deploymentVersion !='All'}">
> <td align="center"> <s:date name="#usercomment.closingDate" format="MM/dd/yyyy" /> </td>
> </s:if>
> </tr>
> </s:iterator>
>
> The <s:iterator> tag is showing properties values(projectNm, subject,comments)correctly. 'deploymentVersion' property is not a member of 'usercomment' and when it is having value 'All' still it is displaying '#usercomment.closingDate' value. I think that it is not validating <s:if> condition correctly inside <s:iterator>. If I move this condition outside of <s:iterator> it is working as expected.
>
> Please let me know, how to validate the properties which are not member of <s:iterator> value.
>
> Thanks,Sharath.
>
>
>
>