• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

s:if not work (struts2)

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm working with a struts 2, and I have a dto with the following information:

public class TimeActions implements java.io.Serializable {

private String esTime;


public String getEsTime() {
return esTime;
}

public void setEsTime(String esTime) {
this.esTime = esTime;
}
}

Then in my jsp:

<s:set name="escalar" value="%{TimeActions.esTime}"/> //the value of escalar is 'S', if I print the value ti show 'S' (this is ok)

<s:if test="%{#escalar=='S'}">
is 'S' //never show this message
</s:if>

My problem is that never show the message is 'S', and the value of escalar is 'S'.

What is wrong?

Thanks in advance, Irene.
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Try this, you can access it directly

 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks , Mohana, but if I write <s:set name="escalar" value="%{esTime}"/> , escalar value is null, the case is if I do:

<s:set name="escalar" value="%{TimeActions.esTime}"/>

And then:

<s:text name="escalar"/>

To appear 'S' correctly.

Thanks in advance.
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Identify the actual using property tag.
 
A tiny monkey bit me and I got tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic